Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

usehistory example

import { useHistory } from 'react-router-dom';

function Home() {
  const history = useHistory();
  return <button onClick={() => history.push('/profile')}>Profile</button>;
}
Source by css-tricks.com #
 
PREVIOUS NEXT
Tagged: #usehistory
ADD COMMENT
Topic
Name
7+4 =