Skip to content

Problem building the dark mode CSS variable example (Gatsby SSR) #531

Answered by ismasgrove
ismasgrove asked this question in Q&A
Discussion options

You must be logged in to vote

Apologies, it was indeed just a React thing, and I needed to use some sort of method to get the image component to re-render. I was a bit thrown off when keys didn't work and how it worked differently on the server-side.

Setting up an initially null useState to defer and ensure a correct first render on the icon's part did the trick. Marking this as answered, thank you.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ismasgrove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant