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