0

anyone know the fix , for this In my project i am using

"react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^5.2.0",

new react version with old router, please help me out

Route

<Route
path={
    '/' +
    Constants.USER_ADMIN_TYPE +
    '/show-details/:name/:showId'
}
render={(props) => (
    <Admin
        userType={Constants.USER_ADMIN_TYPE}
        comp={<ShowDetails {...props} />}
    />
)}
/>

URL I AM SENDING USINSG history.push

<td
onClick={() =>
    props.history.push(
        `/${localStorage.getItem(
            'role'
        )}/Show-details/${
            item.name
        }/${
            item.showId
        }`
    )
}
>
{id + 1}
</td>

I have tried almost all the possible solution to make it workig , but couldn't found a solution till now.

I have set of shows, and onclicking on it only changing the url, not showing the rendered component.

I see on tag href component is rendering the in new page , loaded succesfully .

but on props.history.push it is not renderign the component ,just changing the url

enter image description hereenter image description hereenter image description hereenter image description here

Chandan Nick
  • 31
  • 1
  • 7

0 Answers0