I am getting Material-UI: the component displayName is invalid warning after migration from v3 to v4
See original GitHub issue` console.<computed> | @ | index.js:1437 – | – | – | – | (anonymous) | @ | breadcrumbs.js:76 | printWarning | @ | warning.js:34 | warning | @ | warning.js:58 | (anonymous) | @ | withStyles.js:32 | ./src/pages/App/components/Header/components/MultiISP/index.js | @ | index.js:155 | webpack_require | @ | bootstrap:786 | fn | @ | bootstrap:149 | ./src/pages/App/components/Header/index.js | @ | index.js:550 | webpack_require | @ | bootstrap:786 | fn | @ | bootstrap:149 | ./src/pages/App/index.js | @ | index.js:405 | webpack_require | @ | bootstrap:786 | fn | @ | bootstrap:149 | Promise.then (async) | | | ./src/containers/App.js | @ | App.js:25 | webpack_require | @ | bootstrap:786 | fn | @ | bootstrap:149 | ./src/index.js | @ | CustomStyle.js:209 | webpack_require | @ | bootstrap:786 | fn | @ | bootstrap:149 | 0 | @ | subscriberStatus.js:70 | webpack_require | @ | bootstrap:786 | checkDeferredModules | @ | bootstrap:45 | webpackJsonpCallback | @ | bootstrap:32 | (anonymous) | @ | main.chunk.js:1
`
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (9 by maintainers)
The reason is the wrapped
component
cannot be recognized bywithStyles()
. For example, the code,withStyle(styles)(connect()(MyComponent))
will throw the warning. After changing it to,connect()(withStyle(styles)(MyComponent))
, the warning is fixed.It will be fixed in v4.0.2, this weekend.