This content originally appeared on DEV Community and was authored by Bek Brace
Hey coders🤓 hope you're having an amazing day.
I enjoy coding and learning, especially when I know that I can share my experience with my friends on the internet, so that's why I have coded this very simple minimalist home page with React and Material UI, but I guess what I wanted to achieve is creating a toggle switch for light and dark mode, something that you can see now in modern websites for readers who prefer to not be bothered by the flashing light - like myself - so this switch provides the option to change the page's color to black and font automatically is converted to white.
I think it's cool, and even cooler to know how you can do it in react, I did not create a component as this was the only component in the app, usually i create components when I have more than one element I want to integrate them; but you can optimize the code as you like.
This is the video, and I hope you will enjoy it 🙂
Follow me on twitter and Instagram : @ BekBrace
Join my Facebook page : @bekbraceinc
This content originally appeared on DEV Community and was authored by Bek Brace

Bek Brace | Sciencx (2022-07-03T13:18:39+00:00) Coding a Toggle switch with React.js and Material UI. Retrieved from https://www.scien.cx/2022/07/03/coding-a-toggle-switch-with-react-js-and-material-ui/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.