mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-06-09 07:26:45 +00:00
feat: lots of refactors and improvements
This commit is contained in:
@@ -48,20 +48,20 @@ export default function App({ Component, pageProps }) {
|
||||
const router = useRouter()
|
||||
|
||||
React.useEffect(() => {
|
||||
function onRouteChangeComplete() {
|
||||
Fathom.trackPageview()
|
||||
}
|
||||
|
||||
if (fathomId) {
|
||||
Fathom.load(fathomId, fathomConfig)
|
||||
|
||||
function onRouteChangeComplete() {
|
||||
Fathom.trackPageview()
|
||||
}
|
||||
|
||||
router.events.on('routeChangeComplete', onRouteChangeComplete)
|
||||
|
||||
return () => {
|
||||
router.events.off('routeChangeComplete', onRouteChangeComplete)
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
}, [router.events])
|
||||
|
||||
return <Component {...pageProps} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user