From e5c793b7598bc0bfb0a7f51f1eb68812c3cf9347 Mon Sep 17 00:00:00 2001 From: bottlewook Date: Sun, 18 Feb 2024 23:31:59 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20query=20clear=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/my-page/page.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/my-page/page.tsx b/src/app/my-page/page.tsx index 6b0c9a7a..87efc03d 100644 --- a/src/app/my-page/page.tsx +++ b/src/app/my-page/page.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'; import { useCookies } from 'react-cookie'; +import { useQueryClient } from '@tanstack/react-query'; import classNames from 'classnames/bind'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; @@ -24,6 +25,7 @@ const cx = classNames.bind(styles); function MyProfilePage() { const router = useRouter(); const dispatch = useAppDispatch(); + const query = useQueryClient(); // eslint-disable-next-line @typescript-eslint/no-unused-vars const [cookies, removeCookie] = useCookies(['token']); @@ -41,6 +43,7 @@ function MyProfilePage() { // TODO: 먼저 로그아웃 모달이 뜨도록 할지 논의필요 dispatch(clearUserId()); removeCookie('token', { path: '/' }); + query.clear(); router.push('/'); };