score:41
Accepted answer
just ran into this myself. you can import createtheme
from @mui/material/styles
or @mui/system
, but they do slightly different things:
you can use the utility coming from the
@mui/system
package, or if you are using@mui/material
, you can import it from@mui/material/styles
. the difference is in the defaulttheme
that is used (if no theme is available in the react context).
the one from @mui/material/styles
is smart enough to fill in gaps in the active theme from the default mui theme. so if you're using @mui/material
, then use @mui/material/styles
.
Source: stackoverflow.com
Related Query
- MaterialUI 5 : TypeError: Cannot read properties of undefined (reading 'create')
- React Router: TypeError Cannot read properties of undefined (reading 'originalPositionFor')
- Cannot read properties of undefined (reading 'params') Uncaught TypeError whilte fetching data from JSON
- TypeError: Cannot read properties of undefined (reading 'array_google') reading from JSON file with defined template
- Cannot Read Properties Of Undefined Reading handleCategory
- × TypeError: Cannot read properties of undefined (reading 'map')
- TypeError when using React: Cannot read property 'firstChild' of undefined
- Ag-grid React Table TypeError: Cannot read properties of undefined (reading 'setAriaColIndex')
- React - TypeError: Cannot read properties of undefined (reading 'params')
- Testing React Redux - cannot read properties of undefined, or wrapper undefined
- TypeError: Cannot read properties of undefined (reading 'MethodInfo') in react js app using grpc-web
- Cannot read properties of undefined (reading 'indexOf') with Firebase v9 Modular React JS
- × TypeError: Cannot read properties of undefined (reading 'getState')
- Cannot read properties of undefined (reading 'originalPositionFor')
- TypeError: Cannot read properties of undefined (reading 'toLocaleString')
- MUI - makeStyles - Cannot read properties of undefined
- TypeError: Cannot read properties of undefined (reading 'prototype') React Typescript + Express
- Cannot read properties of undefined (reading 'direction') React JS Material Table
- TypeError: Cannot read properties of undefined (reading 'setState')
- Module build failed (from ./node_modules/eslint-loader/dist/cjs.js): TypeError: Cannot read properties of undefined (reading 'getFormatter')
- MUI error: Cannot read properties of undefined (reading 'drawer')
- Cannot read property 'bind' of undefined React when all properties are defined
- Runtime error appeared after updating to webpack 5. TypeError: Cannot read properties of undefined (reading 'default')
- Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'appendChild')
- 'Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'writeFile')' error while trying to write to a file with REACT
- Cannot read properties of undefined (reading '0')
- Cannot read properties of undefined (reading 'location')
- Cannot read properties of undefined (reading 'map')
- How to fix 'Type Error: Cannot Read Property 'name' of undefined when trying to access properties of an object' in React
- React Google Maps Api :Cannot read properties of undefined reading 'emit'
More Query from same tag
- Hapi server on heroku fails to bind port
- Generic way to convert all instances of null to undefined in Typescript
- Change locale in react-datepicker
- Why doesn't react-sticky work in this simple example?
- disable checkbox selection in Ag-grid
- Question about react class component setState
- useeffect() run and set data to the variable after the return() run in react? how to handle this?
- React - display specific content based on URL using useLocation
- When to use functional setState
- React - The value prop is required for the <Context.Provider>. Did you misspell it or forget to pass it?
- Connecting PHP to React
- How to get the index of data in Cesium
- How to make rating stars in react js?
- Why does Jest try running my whole app rather than the imported modules?
- Asp.Net Core with react and material-ui
- Node 'crypto' SHA256 hashing model behaving erratically
- How to filter the entire array based on user input using filter in JavaScript ?
- ReactJS event.preventDefault(); is not a function
- Creating website.com/newPage in reactjs App when website.com us running react App
- How to give active class on NavItem on browser back
- TypeScript pass props to children
- How to remove the value before the cursor - React
- Value in array equal to key or value in another array
- How do I properly implement the map function with fetch API in React?
- React.JS working with two values in state
- How to use community HTTP plugin in a Ionic React app when running the app on Android Emulator?
- how to toggle a className between two list items in react
- How to make next/image fill available grid space?
- How to assert state in unit test (React JS) while state is updating in axios call?
- How to render a button in parent component based on children action in react js?