Skip to content

Commit

Permalink
build: install and setup TanStack Query (#7)
Browse files Browse the repository at this point in the history
* build: install and setup TanStack Query

* chore: up lockb file

* chore: restore prev module configuration

* chore: restore import css
  • Loading branch information
pure-js authored Sep 17, 2023
1 parent 09c25ff commit d2d80c2
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extends:
- 'next/core-web-vitals'
- prettier
- 'plugin:storybook/recommended'
- 'plugin:@tanstack/eslint-plugin-query/recommended'
- prettier
6 changes: 5 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import './globals.css';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';

import Providers from './providers';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
Expand All @@ -16,7 +18,9 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={inter.className}>
<Providers>{children}</Providers>
</body>
</html>
);
}
13 changes: 13 additions & 0 deletions app/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use client';
import { useState } from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

type ProvidersProps = React.PropsWithChildren<{}>;

export default function Providers({ children }: ProvidersProps) {
const [queryClient] = useState(() => new QueryClient());

return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
);
}
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build-storybook": "storybook build"
},
"dependencies": {
"@tanstack/react-query": "4.35.3",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
Expand All @@ -30,6 +31,7 @@
"@storybook/nextjs": "^7.4.1",
"@storybook/react": "^7.4.1",
"@storybook/testing-library": "^0.2.0",
"@tanstack/eslint-plugin-query": "4.34.1",
"@types/node": "20.6.0",
"@vanilla-extract/css": "1.13.0",
"@vanilla-extract/next-plugin": "2.3.0",
Expand Down
44 changes: 44 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit d2d80c2

Please sign in to comment.