Skip to content

Commit ec7dc92

Browse files
committed
chore: tanstack query 추가
1 parent b443093 commit ec7dc92

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"coverage": "vitest run --coverage"
1313
},
1414
"dependencies": {
15+
"@tanstack/react-query": "5.85.3",
1516
"jotai": "2.13.1",
1617
"react": "^19.1.1",
1718
"react-dom": "^19.1.1"

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/ui/query-provider.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
2+
import { PropsWithChildren, useState } from "react";
3+
4+
export function QueryProvider({ children }: PropsWithChildren) {
5+
const [client] = useState(() => new QueryClient());
6+
return <QueryClientProvider client={client}>{children}</QueryClientProvider>;
7+
}

src/main.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
33

44
import "@/index.css";
5+
import { QueryProvider } from "@/app/ui/query-provider";
6+
57
import App from "./App.tsx";
68

79
createRoot(document.getElementById("root")!).render(
810
<StrictMode>
9-
<App />
11+
<QueryProvider>
12+
<App />
13+
</QueryProvider>
1014
</StrictMode>,
1115
);

0 commit comments

Comments
 (0)