Skip to content
Advertisement

material-ui : enable the dark mode automatically

As per the documentation:

It says dark mode theme will be generated automatically and get reflected in UI, but it is not working for me.

JavaScript

Code:

JavaScript

Signup.js

JavaScript

Background is not getting dark with the type. Can someone help with this?

Advertisement

Answer

My bad. The latest version of Material UI now uses mode attribute of palette to determine whether dark mode or not. Simply change from ‘type’ to ‘mode’:

JavaScript

Complete code of App.js:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement