add tanstakQuery clear for login form
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
'use client'
|
||||
|
||||
import styles from '@/app/styles/module/login.module.scss'
|
||||
import { useActionState, useState, useRef } from 'react';
|
||||
import { useActionState, useState, useRef, useEffect } from 'react';
|
||||
import { authorization } from '@/app/actions/auth';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { IconEye } from '@/app/ui/icons/icons';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
export default function LoginForm() {
|
||||
const [state, formAction, isPending] = useActionState(
|
||||
@@ -20,6 +21,11 @@ export default function LoginForm() {
|
||||
}
|
||||
|
||||
const checkBoxRememberMe = useRef<HTMLInputElement>(null);
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
useEffect(() => {
|
||||
queryClient.clear();
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<form action={formAction}>
|
||||
|
||||
Reference in New Issue
Block a user