diff options
author | Vitaly Takmazov | 2022-10-28 12:48:23 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:58 +0300 |
commit | 13c15825aa6b651439c043c75d9871e52c69cf9f (patch) | |
tree | d09a7540b29aa3fc70be1107170118088916fc45 /vnext/src/ui/Login.js | |
parent | 4039230974bb5275a70797c48f8c4635d253514c (diff) |
Upgrade to `react-router` v6
Diffstat (limited to 'vnext/src/ui/Login.js')
-rw-r--r-- | vnext/src/ui/Login.js | 8 |
1 files changed, 4 insertions, 4 deletions
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(); |