Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

useHistory 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 css-tricks.com #
 
PREVIOUS NEXT
Tagged: #useHistory
ADD COMMENT
Topic
Name
7+4 =