Skip to content
Discussion options

You must be logged in to vote

You can't. Unless you use getServerSideProps. Without that there is no option in Next.js to make a request (to get the user session) in a blocking manner before the page starts to render.

Usually this case is handled by showing some kind of a skeleton UI or a spinner. The former might be more pleasant for the user, as less jumping around would occur, but if it's some kind of a admin dashboard, you might be ok with obscuring the actual UI. If it's absolutely necessary to avoid the flicker, your only option is getServerSideProps.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@thefakequake
Comment options

@balazsorban44
Comment options

@thefakequake
Comment options

Answer selected by balazsorban44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants