Skip to content

Commit 4cb4493

Browse files
Update src/features/Auth/v1/Pages/LoginPage.tsx
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent c885f21 commit 4cb4493

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/features/Auth/v1/Pages/LoginPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const LoginPage = () => {
1414
const [fieldErrors, setFieldErrors] = useState<{ email?: string; password?: string }>({});
1515
const [serverError, setServerError] = useState<string | null>(null);
1616

17-
const validateFields = (email: string, password: string): boolean => {
17+
const validateFields = useCallback((email: string, password: string): boolean => {
1818
const errors: { email?: string; password?: string } = {};
1919

2020
if (!email.trim()) {
@@ -29,7 +29,7 @@ const LoginPage = () => {
2929

3030
setFieldErrors(errors);
3131
return Object.keys(errors).length === 0;
32-
};
32+
}, []);
3333

3434
const handleLogin = useCallback(
3535
async (e: React.FormEvent<HTMLFormElement>) => {

0 commit comments

Comments
 (0)