-
Notifications
You must be signed in to change notification settings - Fork 2
Next.js tips
David Lindkvist edited this page Mar 3, 2023
·
1 revision
export default function DefaultPageTransition({ children }) {
const router = useRouter();
// get a more friendly path name (especially for generic pages instead of [...slug])
const pageName = router.asPath;
return (
<PageTransitions
key={router.isReady ? 'hydrated' : 'ssr'} // make sure ?querystring parsing works
pageName={pageName}
>
{children}
</PageTransitions>
);
}