DEV Community

Suraj Sharma
Suraj Sharma

Posted on

How to build a dark mode theme using React Material UI, React context API and React hooks

This article is about creating your own 'ThemeProvider' component to toggle between the light mode and dark mode built using React Context API and React hooks useMemo() and useCallback() even created a new custom hook useChangeTheme()

I recently added a button to toggle between light mode and dark mode on my personal blog, for that I created a separate library called 'react-material-ui-dark-mode'

If you're interested in reading more about how to build own your toggle button or want to use my library in your projects.

Follow my blog post on my personal website or you can fork the GitHub repository react-material-ui-dark-mode

Please leave your feedback on the comment box below.

Thank You!

Top comments (0)