Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

useHistory: useNavigate if you install v6 or more than react-router-dom": ^6.2.1

import { useNavigate } from "react-router-dom";

 let navigate = useNavigate();


 const onSubmit = async (e) => {
    e.preventDefault();
    await axios.post("http://localhost:3001/users", user);
    navigate(`/`);
 };
Comment

useHistory: useNavigate if you install v6 or more than react-router-dom": ^6.2.1

import { useNavigate } from 'react-router-dom';
Comment

useHistory: useNavigate if you install v6 or more than react-router-dom": ^6.2.1

const navigate = useNavigate();
navigate('/home')
Comment

PREVIOUS NEXT
Code Example
Javascript :: change class on resize window jquery 
Javascript :: koa wildcard route 
Javascript :: javascript intersection reduce, filter, includes 
Javascript :: acced to unknown obkect key js 
Javascript :: typeorm with better sqlite Loading from the database 
Javascript :: typeorm caching queries time limit 
Javascript :: react pdf fixed property not working 
Javascript :: javascript returns odd 
Javascript :: req.parms en react js 
Javascript :: after storing array array state is empty 
Javascript :: stdi nodejs 
Javascript :: how to format date dd/mm/yyyy in javascript 
Javascript :: mindate from another datepicker 
Javascript :: Adding Custom Admin Notices in the Classic Editor wordpress 
Javascript :: golang json time 
Javascript :: reduce() method executes a reducer function on each element of the array and returns a single output value. 
Javascript :: javascript string get numbers 
Javascript :: regular expression for twitter embedded tweets 
Javascript :: what is the maximum x value of a window for mouse listener 
Javascript :: set state giving previously update data 
Javascript :: react onpaste get value 
Javascript :: @click:append 
Javascript :: datatables show loading 
Javascript :: React Readonly rating 
Javascript :: return axios response from seperate file 
Javascript :: axios check if call is already running 
Javascript :: GET / - - ms - - node js 
Javascript :: react native carriage return 
Javascript :: angular data table push not working 
Javascript :: javascript paragraph class 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =