-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
The Select examples from the Styleguide should render on React 15.6.
Reality
Uncaught Error: FieldContainer.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
It returns an array, because FieldContainer.render() (at https://github.com/zendeskgarden/react-components/blame/master/packages/selection/src/containers/FieldContainer.js#L86) calls the anonymous render prop function in SelectField (at https://github.com/zendeskgarden/react-components/blob/master/packages/select/src/elements/SelectField.js#L63-L92) which returns React.Children.map(...).
React.Children.map() returns an array.
For comparison, the TextField's render prop function wraps the array returned by React.children.map() in a <TextGroup>, which avoids this problem. TextField works fine in React 15.6.
Fine Print
- Component: SelectField
- Browsers: all
Metadata
Metadata
Assignees
Labels
No labels