Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #usehistory #exported
ADD COMMENT
Topic
Name
9+8 =