Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React @material-ui/core - v4.11.0 - "the createMuiTheme function was renamed to createTheme" console error

My react project only logging this error(console error) when the service on production level. I don't see the following error on my local, but only on production mode.

Material-UI: the createMuiTheme function was renamed to createTheme. You should use `import { createTheme } from '@material-ui/core/styles'`

I found a few articles saying this only happens when anything above v5 of @material-ui/core has been used. However, I'm using v4.11.0 of @material-ui/core which only supports createMuiTheme. Since the version is below v5, I reckon the error should not be shown at any point during runtime.

For those who have any clue regarding this issue, please share. Thank you.

like image 978
Ray Jeong Avatar asked Jul 27 '21 11:07

Ray Jeong


People also ask

Is createMuiTheme deprecated?

Developers - createMuiTheme was deprecated -

Is material UI compatible with TypeScript?

MUI requires a minimum version of TypeScript 3.5. Have a look at the Create React App with TypeScript example. The strict mode options are the same that are required for every types package published in the @types/ namespace.


1 Answers

Same goes to me. Probably updated deprecated function name createMuiTheme to createTheme used in ThemeProvider.

https://github.com/elyra-ai/elyra/pull/1885

like image 59
TIshow Avatar answered Oct 20 '22 14:10

TIshow