usehistory is not exported from react-router-dom

112

usehistory is not exported from react-router-dom -

In react-router-dom V6 useHistory() is replaced by useNavigate()

you can use:

import {useNavigate} from 'react-router-dom';
const navigate = useNavigate();
navigate('/home');

Comments

Submit
0 Comments