Material-ui: [react] Drop support for React v15.x and take advantage of v16.0.0 once released

Created on 5 Aug 2017  路  9Comments  路  Source: mui-org/material-ui

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')
)

Versions

  • Material-UI: 1.0.0-beta.2
  • React: 16.0.0-beta.3
  • Browser: Safari
On hold

Most helpful comment

@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:

  • [ ] Update the propTypes
  • [ ] Update the render methods
  • [ ] Remove Portal dead code
  • [ ] Upgrade enzyme

All 9 comments

@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:

  • [ ] Update the propTypes
  • [ ] Update the render methods
  • [ ] Remove Portal dead code
  • [ ] Upgrade enzyme

@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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rbozan picture rbozan  路  3Comments

ghost picture ghost  路  3Comments

reflog picture reflog  路  3Comments

activatedgeek picture activatedgeek  路  3Comments

revskill10 picture revskill10  路  3Comments