Skip to content

How to use Page transitions in next.js #1711

Answered by joshuaellis
pi43r asked this question in Support
Discussion options

You must be logged in to vote

This would go in _app.js in the pages folder. Typically what i've done in the past for a basic fade in/out is have a div that covers the whole page that has an opacity 0 and the spring changes that to 1 through listening to router events. So on changeStart you would show the div covering the screen, on changeComplete you would hide it again giving the illusion the page faded out which is much simpler than trying to apply animated props correctly to the passed Component.

I can see you're using react-three-next you might have more luck asking in that repo because it messes with the app.js file.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@pi43r
Comment options

Answer selected by pi43r
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants