-
Notifications
You must be signed in to change notification settings - Fork 0
[refactor] user 정보 관련된 Header에 render 관련 리팩터링 #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- cookie를 받아서 체크하는 api routes 추가 - App 컴포넌트에서 쿠키를 통해 로그인 여부 체크하는 api routes로 preFetching
| import { userKeys } from "./queryKeys"; | ||
|
|
||
| export default function useUserQuery(cookies?: Record<string, string>) { | ||
| return useQuery({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useSuspensequery를 사용했을 때 문제가 있었는데 정확한 이유를 추후 찾아 수정할 필요있음
|
|
||
| export default function UserDropdown() { | ||
| const { user } = useContext(UserContext); | ||
| const { data: user } = useUserQuery(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
당장에 구현에는 설계한 방향으로 진행되고 있으나, tanstack query 캐싱이 아닌 브라우저의 http 캐싱으로 캐싱되어 이루어지고 있는 것 같음.
이 부분 다음 이슈 또는 추후에 개선이필요함
구현한 것