Top "React-router-dom" questions

Use this tag for questions regarding DOM use and bindings of React Router v4, v5, and v6.

How to redirect to another class component/Page in ReactJs

How to redirect from one class component to another class component/fresh page in ReactJS. Currently, I am able to …

reactjs navigation react-router react-router-dom multi-page-application
How to mock history.push with the new React Router Hooks using Jest

I am trying to mock history.push inside the new useHistory hook on react-router and using @testing-library/react. I just …

reactjs react-router jestjs react-router-dom react-testing-library
Redirect to login page in react router 4

I am new to react and still learning my way around. I am creating a single page app where the …

javascript reactjs react-router-v4 react-router-dom
reset component's internal state on route change

I am using react-router-v4 along with react 16. I want to reset the component's internal state when the user go to …

reactjs react-router react-router-v4 react-router-dom
react-router-dom: getting props.location from within <BrowserRouter> component

I have a simple App that uses BrowserRouter from 'react-router-dom' v4. I'm trying to access the location.pathname property from …

reactjs react-router-dom
React Redux and react-router-dom

I am learning Redux, and with the new changes in react-router-dom I am a bit confused. I have these files: …

javascript reactjs redux react-router-dom
Pass id as props in react-router-dom

I would like to pass an ID in props to a component react I use react-router-dom Here is my app.…

javascript reactjs react-router-dom
How to send params in useHistory of React Router Dom?

I am using React Router hooks for navigation useHistory. Navigate : history.push("/home", { update: true }); In home : I am trying …

reactjs react-hooks react-router-dom
React-toastify showing multiple toast

I am building a React app with several components and in at least half of them I am using React-notify …

javascript reactjs react-router-dom react-toastify