forked from sifat0666/multivendor-ecom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_app.tsx
35 lines (23 loc) · 783 Bytes
/
_app.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import '../styles/globals.css'
import type { AppProps } from 'next/app'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import Navbar from '../components/Navbar'
import { GoogleOAuthProvider } from '@react-oauth/google'
import { useEffect, useState } from 'react'
function MyApp({ Component, pageProps }: AppProps) {
const [isSSR, setIsSSR] = useState(true)
useEffect(()=> {
setIsSSR(false)
}, [])
if(isSSR) return null
const queryClient = new QueryClient()
return(
<GoogleOAuthProvider clientId={process.env.NEXT_PUBLIC_GOOGLE_API_TOKEN!}>
<QueryClientProvider client={queryClient}>
<Navbar />
<Component {...pageProps} />
</QueryClientProvider>
</GoogleOAuthProvider>
)
}
export default MyApp