Answers for "uselocation hook in react"

9

uselocation hook

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

function Home() {
  const history = useHistory();
  return <button onClick={() => history.push('/profile')}>Profile</button>;
}
Posted by: Guest on May-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language