Conversation
src/main.tsx
Outdated
| defaultOptions: { | ||
| queries: { | ||
| refetchOnWindowFocus: false, | ||
| retryOnMount: true, |
Collaborator
There was a problem hiding this comment.
p2) retryOnMount 옵션은 v4 기준으로 이제 사용되지 않는다고 해요!
retryOnMount 대신 refetchOnMount와 retry 옵션을 같이 사용하는 게 요즘 권장하는 방식이라고 합니당
https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults#refetchonmount
Collaborator
There was a problem hiding this comment.
p3) queryClient 부분 별도 파일로 분리해도 좋아 보이네욤
Contributor
Author
There was a problem hiding this comment.
@jisooooooooooo 그러면 queryClient 설정을 src/common/util/queryClient.ts로 분리하겠습니다 ! queryClient는 특정 도메인에 속하지 않고 전역적으로 사용되는 설정이므로 common 영역에 배치하고, 외부 라이브러리를 사용한 설정이지만 컴포넌트가 아닌 유틸리티 성격이므로 util 폴더에 위치시켰습니당
Leeyoonji23
approved these changes
Jul 4, 2025
Contributor
|
충돌 해결하시고 머지 해주세요! |
🎨 스토리북 배포 완료!변경된 컴포넌트의 디자인을 확인해주세요. |
🎨 스토리북 배포 완료!변경된 컴포넌트의 디자인을 확인해주세요. |
빌드 결과빌드 성공 🎉 |
🎨 스토리북 배포 완료!변경된 컴포넌트의 디자인을 확인해주세요. |
jisooooooooooo
approved these changes
Jul 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Summary
Tanstack Query 기본 세팅을 완료했습니다.
✅ Tasks
@tanstack/react-query,@tanstack/react-query-devtools패키지 설치👀 To Reviewer
pnpm install해주세요 !!React Query 기본 설정
staleTime & refetchOnWindowFocus 설정 이유
TanStack Query의 기본값(staleTime: 0ms, refetchOnWindowFocus: true)에서는 컴포넌트 마운트나 탭 전환 시마다 불필요한 API 요청이 발생하여 개발 효율성과 사용자 경험을 저하시킬 수 있다고 생각합니다.
이를 개선하기 위해 staleTime을 1분으로 설정하여 데이터 재사용을 허용하고, refetchOnWindowFocus를 false로 설정하여 의도치 않은 자동 재요청을 방지했습니다.
DevTools 설정
📸 Screenshot