-
Notifications
You must be signed in to change notification settings - Fork 2
[Init]: Tanstack Query 기본 세팅 #18
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
Changes from 1 commit
adbfe43
9acd6b7
9d5c807
d1af47b
6262a4e
6032c97
eadd9d3
4636dd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,30 @@ | ||
| import { StrictMode } from 'react' | ||
| import { createRoot } from 'react-dom/client' | ||
| import App from './App.tsx' | ||
| import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
| import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; | ||
|
|
||
| createRoot(document.getElementById('root')!).render( | ||
| const queryClient = new QueryClient({ | ||
| defaultOptions: { | ||
| queries: { | ||
| refetchOnWindowFocus: false, | ||
| retryOnMount: true, | ||
|
||
| refetchOnReconnect: false, | ||
| retry: 2, | ||
| }, | ||
| mutations: { | ||
| retry: 1, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| createRoot(document.getElementById("root")!).render( | ||
| <StrictMode> | ||
| <App /> | ||
| </StrictMode>, | ||
| ) | ||
| <QueryClientProvider client={queryClient}> | ||
| <App /> | ||
| {import.meta.env.DEV && ( | ||
| <ReactQueryDevtools initialIsOpen={false} /> | ||
| )} | ||
| </QueryClientProvider> | ||
| </StrictMode> | ||
| ); | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
p3)
queryClient부분 별도 파일로 분리해도 좋아 보이네욤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.
@jisooooooooooo 그러면 queryClient 설정을
src/common/util/queryClient.ts로 분리하겠습니다 ! queryClient는 특정 도메인에 속하지 않고 전역적으로 사용되는 설정이므로 common 영역에 배치하고, 외부 라이브러리를 사용한 설정이지만 컴포넌트가 아닌 유틸리티 성격이므로 util 폴더에 위치시켰습니당