DEV Community

Discussion on: Create a React hook to add dark theme to your app

Collapse
 
marklai1998 profile image
Mark Lai • Edited

there is a package called constate can help you simplify most of the context part
instead of putting the logic inside ThemeProvider wrapper
you can simply create a hook called useTheme and all component that use it will share the same hook instance