diff --git a/src/pages/MainPage.js b/src/pages/MainPage.js index fc274d3c..289d3e00 100644 --- a/src/pages/MainPage.js +++ b/src/pages/MainPage.js @@ -28,8 +28,12 @@ async function checkTokenValid() { function MainPage() { const setIsLogin = useSetRecoilState(isLogin); + const checkIsLogin = async () => { + setIsLogin(await checkTokenValid()); + }; + useEffect(() => { - setIsLogin(checkTokenValid()); + checkIsLogin(); }, []); return ( <>