-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path_app.tsx
More file actions
39 lines (33 loc) · 1010 Bytes
/
_app.tsx
File metadata and controls
39 lines (33 loc) · 1010 Bytes
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
36
37
38
39
import type { AppProps } from 'next/app'
import tailwindStyle from './_app.scss'
import Head from 'next/head'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import { pageview } from 'utils/googleAnalytics'
const App = ({ Component, pageProps }: AppProps) => {
const router = useRouter()
useEffect(() => {
const handleRouteChange = (url: string) => pageview(url)
router.events.on('routeChangeComplete', handleRouteChange)
return () => router.events.off('routeChangeComplete', handleRouteChange)
}, [router.events])
return (
<>
<Head>
<meta
name="viewport"
content="initial-scale=1.0, minimal-ui, width=device-width, viewport-fit=cover"
/>
<meta
name="naver-site-verification"
content="880d54d70f5931580d52103c45da00329ee3d31b"
/>
</Head>
<style jsx global>
{tailwindStyle}
</style>
<Component {...pageProps} />
</>
)
}
export default App