Answers for "history in react hooks"

1

use history react router dom

import { useHistory } from "react-router-dom";
Posted by: Guest on August-13-2021
0

use history react router dom

const history = useHistory();
Posted by: Guest on August-13-2021
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

Code answers related to "Javascript"

Browse Popular Code Answers by Language