diff --git a/Libraries/Components/Picker/PickerIOS.ios.js b/Libraries/Components/Picker/PickerIOS.ios.js index 1f47a53a97a11e..28514b0bfbba62 100644 --- a/Libraries/Components/Picker/PickerIOS.ios.js +++ b/Libraries/Components/Picker/PickerIOS.ios.js @@ -91,16 +91,18 @@ class PickerIOS extends React.Component { static getDerivedStateFromProps(props: Props): State { let selectedIndex = 0; const items = []; - React.Children.toArray(props.children).forEach(function(child, index) { - if (child.props.value === props.selectedValue) { - selectedIndex = index; - } - items.push({ - value: child.props.value, - label: child.props.label, - textColor: processColor(child.props.color), + React.Children.toArray(props.children) + .filter(child => child !== null) + .forEach(function(child, index) { + if (child.props.value === props.selectedValue) { + selectedIndex = index; + } + items.push({ + value: child.props.value, + label: child.props.label, + textColor: processColor(child.props.color), + }); }); - }); return {selectedIndex, items}; }