Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

_app.tsx

19 lines563 Bytes

1import React from 'react'
2import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
3import Head from 'next/head'
4import type { AppProps } from 'next/app'
5​
6export default function MyApp({ Component, pageProps }: AppProps) {
7 const [queryClient] = React.useState(() => new QueryClient())
8​
9 return (
10 <QueryClientProvider client={queryClient}>
11 <Head>
12 <title>
13 TanStack React Query Prefetching Example (Next.js Pages Router)
14 </title>
15 </Head>
16 <Component {...pageProps} />
17 </QueryClientProvider>
18 )