We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c885f21 commit 4cb4493Copy full SHA for 4cb4493
1 file changed
src/features/Auth/v1/Pages/LoginPage.tsx
@@ -14,7 +14,7 @@ const LoginPage = () => {
14
const [fieldErrors, setFieldErrors] = useState<{ email?: string; password?: string }>({});
15
const [serverError, setServerError] = useState<string | null>(null);
16
17
- const validateFields = (email: string, password: string): boolean => {
+ const validateFields = useCallback((email: string, password: string): boolean => {
18
const errors: { email?: string; password?: string } = {};
19
20
if (!email.trim()) {
@@ -29,7 +29,7 @@ const LoginPage = () => {
29
30
setFieldErrors(errors);
31
return Object.keys(errors).length === 0;
32
- };
+ }, []);
33
34
const handleLogin = useCallback(
35
async (e: React.FormEvent<HTMLFormElement>) => {
0 commit comments