Skip to content
Advertisement

Tag: react-hooks

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. Code: Signup.js Background is not getting dark with the type. Can someone help with this? Answer My bad. The latest version of Material UI now uses mode attribute of palette to determine whether dark mode

react context is giving undefined object

In my react application I am trying to use context api. In my component I am importing the context but it is giving error that object can not destructure the property. I am trying to implement cart functionality in my app. I am using hooks. ImgContext.js ImageGrid.js Answer You are not providing a a default value when creating the context.

Advertisement