Answers for "history get state react hooks"

1

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')
Posted by: Guest on November-09-2020
0

how to get state value from history react

history.push({
  pathname: '/path',
  customNameData: yourData,
});
Posted by: Guest on July-28-2020
0

how to get state value from history react

history.push('/path', yourData);
Posted by: Guest on July-28-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language