diff --git a/frontend/src/pages/Login/index.tsx b/frontend/src/pages/Login/index.tsx index c2fc2d08..488a3e27 100644 --- a/frontend/src/pages/Login/index.tsx +++ b/frontend/src/pages/Login/index.tsx @@ -1,4 +1,4 @@ -import React, { useState, ChangeEvent } from "react"; +import React, { useEffect, useRef, useState, ChangeEvent } from "react"; import { Alert, Button } from "components"; import { useAuthState } from "context"; @@ -6,6 +6,7 @@ import { useAuthState } from "context"; import logo from "../../img/logo-text-vertical-grey.png"; function Login() { + const emailRef = useRef(null); const { login } = useAuthState(); const [loading, setLoading] = useState(false); const [errorMessage, setErrorMessage] = useState(""); @@ -31,6 +32,11 @@ function Login() { setFormData({ ...formData, [target.name]: target.value }); }; + useEffect(() => { + // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'. + emailRef.current.focus(); + }, []); + return (