Thanks for the article. was really helpful. Just wanted to highlight a thing.
I was encountering one minor issue the second useffect was setting the theme to light whenever we refreshed the app. I guess this was due to React.StrictMode
OH, that's right! Sorry, I seemed to have forgotten to mention that fact. I hope everything is working as expected now! Feel free to ask if there are any other issues.