Skip to content

Commit

Permalink
🛠 fix : recoil 사용 불가.. 일단 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
seondal committed Feb 20, 2024
1 parent 3628680 commit 2f62593
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
9 changes: 0 additions & 9 deletions src/app/(Sub)/menu/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
'use client';

import { useRecoilValue } from 'recoil';

import MenuListSection from './components/MenuListSection';
import LoginSection from '@/app/(Main)/mypose/components/LoginSection';
import { MenuHeader } from '@/components/Header';
import { userAtom } from '@/context/userState';

export default function MenuPage() {
const userdata = useRecoilValue(userAtom);
console.log('!!');
console.log('🚀 ~ MenuPage ~ userdata:', userdata);

return (
<div className="px-20">
<MenuHeader />
Expand Down
8 changes: 4 additions & 4 deletions src/app/api/users/login/oauth/kakao/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import { useRouter, useSearchParams } from 'next/navigation';
import { useEffect } from 'react';
import { useSetRecoilState } from 'recoil';
// import { useSetRecoilState } from 'recoil';

import { getRegister } from '@/apis';
import { userAtom } from '@/context/userState';
// import { userAtom } from '@/context/userState';

export default function Page() {
const code = useSearchParams().get('code');
const router = useRouter();
const setUserState = useSetRecoilState(userAtom);
// const router = useRouter();
// const setUserState = useSetRecoilState(userAtom);

useEffect(() => {
if (code) {
Expand Down
1 change: 0 additions & 1 deletion src/context/userState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ import { atom } from 'recoil';

import { RegisterResponse } from '@/apis';

export const isLoginAtom = atom<boolean>({ key: 'isLogin', default: false });
export const userAtom = atom<RegisterResponse>({ key: 'user' });

0 comments on commit 2f62593

Please sign in to comment.