From 1bf98025d00e7d42cc52d1ff05347bd414385e1d Mon Sep 17 00:00:00 2001 From: Shubhankar Srivastava <94240750+shubhankar132@users.noreply.github.com> Date: Wed, 20 Mar 2024 01:30:05 +0530 Subject: [PATCH] Update Signup.js useHistory() is no longer supported in react-router-dom v6 --- frontend/src/components/Authentication/Signup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Authentication/Signup.js b/frontend/src/components/Authentication/Signup.js index f137580..b87676d 100644 --- a/frontend/src/components/Authentication/Signup.js +++ b/frontend/src/components/Authentication/Signup.js @@ -5,13 +5,13 @@ import { VStack } from "@chakra-ui/layout"; import { useToast } from "@chakra-ui/toast"; import axios from "axios"; import { useState } from "react"; -import { useHistory } from "react-router"; +import { useNavigate } from "react-router"; const Signup = () => { const [show, setShow] = useState(false); const handleClick = () => setShow(!show); const toast = useToast(); - const history = useHistory(); + const navigate = useNavigate(); const [name, setName] = useState(); const [email, setEmail] = useState(); @@ -70,7 +70,7 @@ const Signup = () => { }); localStorage.setItem("userInfo", JSON.stringify(data)); setPicLoading(false); - history.push("/chats"); + navigate("/chats"); } catch (error) { toast({ title: "Error Occured!",