DEV Community

Discussion on: Page Transition Effect in NextJS

Collapse
koraysels profile image
Koray S.

I also noticed something strange when compiled with SSR. between pages you get a flash of unstyled content. when you are running the dev server this is not visible

Collapse
anxiny profile image
Anxin.Y Author

I have not running into this issue so far. Do you mind share how you compiled your files?

Collapse
koraysels profile image
Koray S.

looks like the stylesheets get unloaded right in between the transitions..

Collapse
shaan_alam profile image
Shaan Alam

Having same issue !

Thread Thread
abioze profile image
Abioze

Having the same issue. anyone have a solution?

Collapse
rhernandog profile image
Rodrigo Hernando

I ran into this issue as well but from a different direction. I was working on page transitions using React Transition Group and the <SwitchTransition> component, with GSAP to create page transitions and had this problem of the styles. As you mention everything works great on development but in production the problems start.
The only solution I found so far is not use modules as the styling approach and have a single CSS file, which is not ideal.

I made this repo:
github.com/rhernandog/next-gsap-tr...
Here is live:
cranky-heyrovsky-83f0a9.netlify.app/