Failed prop type: Invalid prop `children` of type `array` supplied to `MuiThemeProvider`, expected a single ReactElement.
In react@16 we can return an array with the render method.
In this way, should not "MuiThemeProvider" allow arrays?
render(
<MuiThemeProvider theme={theme}>
<LeftMenu />
<Content />
<Snackbar />
</MuiThemeProvider>,
document.querySelector('div')
)
@uufish I think that we should wait for officially dropping [email protected] before updating the propTypes and possibly some of our component implementations.
Check list:
@oliviertassinari React 16 have already been released, will you remove status onHold from this issue?
One of react-jss deps contains a library theming with non peer react 15 dependency, seems like it caused a bug in some of our projects
@istarkov This one was for you #8408 鉂わ笍 . Anyway, this PR #8121 might help as Material-UI runtime code do not rely on theming. But if you are saying that it fails at the installation time, you might be able to use this trick: https://github.com/reactjs/react-transition-group/issues/151#issuecomment-332290728
I have found one limitation with using the new array children capability of React@16. Preact do not support it (https://github.com/developit/preact-compat/issues/432).
So we have a call to make, does supporting preact worth the extra divs in the DOM for React users? #7721
There are quite a few other libraries in the eco system that don't support react 15 yet (zeit/next.js) for one so I'd vote to keep react 15 support for a while. It might also help lessen the curve of upgrading to 1.0 from 0.1x
@eyn zeit/next.js will support react 16 soon: https://github.com/zeit/next.js/issues/2997#issuecomment-333327916 :tada:
fyi: next 4 supports react 16 (and dropped 15 support)
Most helpful comment
@uufish I think that we should wait for officially dropping
[email protected]before updating thepropTypesand possibly some of our component implementations.Check list: