-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed prop type: Invalid prop children
supplied to ThemeProvider
, expected a ReactNode.
#45432
Comments
Can you share the repo? I don't recall that the |
Good afternoon, here is an example. The project is already built and located in the "public" folder. You can launch index.html. |
As you can see from the const theme = (0,_mui_material__WEBPACK_IMPORTED_MODULE_2__["default"])();
const App = () => {
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_3__["default"], { theme: theme, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: "1" }) }));
};
const root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(document.getElementById("app"));
root.render((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(App, {})); It's common to remove PropTypes from production build, please try to use https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @bartplay2499 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
The thing is, this is not a production build, it's a development build, and it shows a bunch of warnings during development. In version 5.x.x, this behavior did not occur. All other settings and libraries remained the same. Only MUI was updated. package.json
webpack.config.development.js
|
Steps to reproduce
Current behavior
A lot of warnings are shown in the console, even with a minimal application like this:
Expected behavior
There should be no warnings.
Context
No response
Your environment
No response
Search keywords: children, ReactNode, Invalid prop
The text was updated successfully, but these errors were encountered: