Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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')
Comment

useHistory() hook

// useHistory() has been changed in v6, so instead use useNavigate()

check out the source link
Comment

PREVIOUS NEXT
Code Example
Javascript :: get element by tag name 
Javascript :: .env not working on react 
Javascript :: tailwind in react 
Javascript :: javascript word count 
Javascript :: nodejs recursively read directory 
Javascript :: jquery 3.6.0 cdn 
Javascript :: how to reverse an array in javascript 
Javascript :: js every x seconds 
Javascript :: get all classes of element jquery 
Javascript :: angular add font 
Javascript :: fs.unlink 
Javascript :: create path if not exist node js 
Javascript :: jquery id click 
Javascript :: add border to view react native 
Javascript :: get caret position javascript 
Javascript :: eslint ignore 
Javascript :: pipe of date angular 
Javascript :: what can i delete from create-react-app 
Javascript :: how to detect account change in metamask 
Javascript :: js import jquery 
Javascript :: clear textbox js 
Javascript :: isempty is not defined 
Javascript :: add variables in javascript 
Javascript :: ajax uploading progress 
Javascript :: loop through map in js 
Javascript :: axios withcredentials 
Javascript :: how to disable react in jsx scope eslint 
Javascript :: mongoose unique field 
Javascript :: javascript base64 encode file input 
Javascript :: append to top javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =