aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Login.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-11-14 13:44:52 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:55 +0300
commit841ec978bae3297357c3157a3adf846648771770 (patch)
tree7163d3a814fd68193f04415e5f1aeaf8a2cfd0a4 /vnext/src/ui/Login.js
parent3900358ca6eeac546cbe0eb0bd36572ddc404634 (diff)
react-router-dom hooks
Diffstat (limited to 'vnext/src/ui/Login.js')
-rw-r--r--vnext/src/ui/Login.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/vnext/src/ui/Login.js b/vnext/src/ui/Login.js
index 883a4eab..0c6f5d0c 100644
--- a/vnext/src/ui/Login.js
+++ b/vnext/src/ui/Login.js
@@ -1,6 +1,5 @@
import React, { useEffect } from 'react';
-
-import { withRouter } from 'react-router-dom';
+import { useLocation, useHistory } from 'react-router-dom';
import Icon from './Icon';
import Button from './Button';
@@ -14,8 +13,6 @@ import './Login.css';
/**
* @typedef {Object} LoginProps
* @property {import('../api').SecureUser} visitor
- * @property {import('history').History} history
- * @property {import('history').Location} location
* @property {any} onAuth
*/
@@ -23,7 +20,10 @@ import './Login.css';
* Login page
* @param {LoginProps} props
*/
-function Login({ visitor, history, location, onAuth }) {
+function Login({ visitor, onAuth }) {
+
+ const location = useLocation();
+ const history = useHistory();
useEffect(() => {
if (visitor.hash) {
@@ -76,7 +76,7 @@ function Login({ visitor, history, location, onAuth }) {
);
}
-export default withRouter(Login);
+export default Login;
const socialButtonsStyle = {
display: 'flex',