| Tech | Version |
| -------------------- | ------- |
| @material-ui/pickers | 3.2.7 |
| material-ui | 4.4.3 |
| React | 16.10.1 |
| Browser | Firefox 69.0.3|
| Peer library | moment |
<MuiPickersUtilsProvider libInstance={moment} utils={MomentUtils}>
<h1>Component</h1>
<p>More than one sub component</p>
</MuiPickersUtilsProvider >
No warning, renders both sub components
Renders both sub components, but browser console says:
Warning: Failed prop type: Invalid prop `children` supplied to `MuiPickersUtilsProvider`.
in MuiPickersUtilsProvider (created by MyParentComponent)
in ...
Wrap the sub components in a React.Fragment
<MuiPickersUtilsProvider libInstance={moment} utils={MomentUtils}>
<>
<h1>Component</h1>
<p>More than one sub component</p>
</>
</MuiPickersUtilsProvider >
same issue
Same issue for me, my workaround was to wrap each picker with the MuiPickersUtilsProvider.
Thanks for the report, the prop-type is wrong:
It should be using children: PropTypes.node.
Note that this provider might go away in v4.
Note that this provider might go away in v4.
Still seems to be a thing in v4. Using the alpha and It's very nice.
The fate of MuiPickersUtilsProvider is unclear in v4. We have been discussing a couple of possible options. I wonder how we could better support these cases:
What's our best move?
cc @mui-org/core
@oliviertassinari Isn't the discussion about the future of the provider out of scope for this particular issue? This is just about fixing prop type validation.