Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

useHistory is not exported form react-router-dom

In react-router-dom version 6 
useHistory() is replaced by useNavigate() ;

import {useNavigate} from 'react-router-dom';
const navigate = useNavigate();
navigate('/home')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #useHistory #exported #form
ADD COMMENT
Topic
Name
4+7 =