14islands / react-page-transitions

Framework agnostic page transition lib
MIT License
26 stars 2 forks source link

Querystring in pathname messes up appear sequence with Next.js #1

Closed ffdead closed 1 year ago

ffdead commented 1 year ago

The extra re-renders caused by the router hydrating client-side seems to confuse react-transition-group.

Workaround:

 const router = useRouter();

 <PageTransitions key={router.isReady ? 'hydrated' : 'ssr'}>
   {children}
 </PageTransitions>
ffdead commented 1 year ago

Added some nextjs tips in the wiki: https://github.com/14islands/react-page-transitions/wiki/Next.js-tips