Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"chromatic": "chromatic --exit-zero-on-changes"
},
"dependencies": {
"@tanstack/react-query": "^5.81.5",
"@reduxjs/toolkit": "^2.8.2",
"axios": "^1.10.0",
"react": "^19.1.0",
Expand All @@ -24,6 +25,7 @@
"devDependencies": {
"@chromatic-com/storybook": "^4.0.1",
"@eslint/js": "^9.29.0",
"@tanstack/react-query-devtools": "^5.81.5",
"@storybook/addon-a11y": "^9.0.15",
"@storybook/addon-docs": "^9.0.15",
"@storybook/addon-essentials": "^8.6.14",
Expand Down
38 changes: 38 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file removed src/common/util/.gitkeep
Empty file.
16 changes: 16 additions & 0 deletions src/common/util/queryClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { QueryClient } from '@tanstack/react-query';

export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 1000 * 60 * 1,
refetchOnWindowFocus: false,
refetchOnMount: true,
refetchOnReconnect: false,
retry: 2,
},
mutations: {
retry: 1,
},
},
});
10 changes: 9 additions & 1 deletion src/main.tsx
Copy link
Copy Markdown
Collaborator

@jisooooooooooo jisooooooooooo Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3) queryClient 부분 별도 파일로 분리해도 좋아 보이네욤

Copy link
Copy Markdown
Contributor Author

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 폴더에 위치시켰습니당

Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import App from './App.tsx';

Check warning on line 4 in src/main.tsx

View workflow job for this annotation

GitHub Actions / build

`./App.tsx` import should occur after import of `@tanstack/react-query-devtools`

Check warning on line 4 in src/main.tsx

View workflow job for this annotation

GitHub Actions / build

`./App.tsx` import should occur after import of `@tanstack/react-query-devtools`

import './style/global.css.ts';
import { QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';

import { queryClient } from './common/util/queryClient.ts';

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
<QueryClientProvider client={queryClient}>
<App />
{import.meta.env.DEV && <ReactQueryDevtools initialIsOpen={false} />}
</QueryClientProvider>
</StrictMode>,
);
Loading