React
useEffect
- useEffect runs only once, when the component is mounted if you pass it an empty array as a second argument. If you don’t pass the second parameter, it runs every time the component renders, that is to say, every time it’s state or props change.
useHistory
const history = useHistory();
...
history.push("/some-path");
Routing
npm i react-router-dom