What package/library is best for theme changing in react? I would mention that I’m not using Tailwind, just simple scss. Is there a similar alternative like next-themes is for nextjs? Or what do you suggest for best performance for changing theme (dark mode/light mode).
2
Answers
For changing theme you should prefer React Context API – create context to manage your theme state (dark / light ) and provide it throughout your component tree or if there is another way i would really like to know…
You can try the classical theming of React’s Material UI or, if you want just a package use-dark-mode.
You can install this last one with:
And to use it for example: