Skip to content
Discussion options

You must be logged in to vote

Thank you for your answer.

I actually found a logical solution that was right in front of my eyes.

All I needed to do, was to insert the following line above the return statement in my theme-context.tsx file:
if (!theme) return null;

This prevents the page's content from loading until the correct theme has been retrieved from the local storage on the client side.
Optionally you can add a fade in animation to make the loading transition more smooth.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@lindjacob
Comment options

Answer selected by lindjacob
@sayedragab27
Comment options

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
4 participants