What do you want to save?
Add Code snippet
New code examples
-
-
Javascript 2021-10-06 13:54:03
chrome back button click event react
import { useHistory } from 'react-router-dom' const [ locationKeys, setLocationKeys ] = useState([]) const history = useHistory() useEffect(() => { return history.listen(location => { if (history.action === 'PUSH') { setLocationKeys([... Add solution -
-
-
Javascript 2021-10-02 10:07:03
in react js how to access history in component
import { useHistory } from "react-router-dom"; function HomeButton() { let history = useHistory(); function handleClick() { history.push("/home"); } return ( <button type="button" onClick={handleClick}&g... Add solution -