From 13c15825aa6b651439c043c75d9871e52c69cf9f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 28 Oct 2022 12:48:23 +0300 Subject: Upgrade to `react-router` v6 --- vnext/src/ui/Login.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vnext/src/ui/Login.js') diff --git a/vnext/src/ui/Login.js b/vnext/src/ui/Login.js index fc3922c8..5a96c822 100644 --- a/vnext/src/ui/Login.js +++ b/vnext/src/ui/Login.js @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { useLocation, useHistory } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router-dom'; import Icon from './Icon'; import Button from './Button'; @@ -22,15 +22,15 @@ import './Login.css'; function Login({ visitor, onAuth }) { const location = useLocation(); - const history = useHistory(); + const navigate = useNavigate(); useEffect(() => { if (visitor.hash) { const {retpath } = location.state || '/'; console.log(retpath); - history.push(retpath); + navigate(retpath); } - }, [history, location.state, visitor]); + }, [navigate, location.state, visitor]); const { register, handleSubmit, formState: { errors }, } = useForm(); -- cgit v1.2.3