react-native/Libraries
Atticus White 2e4ab9ff70 Bugfix - Only add valid IOSPicker items.
Summary:
Fixes https://github.com/facebook/react-native/issues/9216.

As nickzuber describes in #9216, conditional `Picker.Item` elements will lead to exceptions downstream when the `Picker` attempts to construct the collection of items.

[In the picker source](a2fb703bbb/Libraries/Components/Picker/PickerIOS.ios.js (L48-L53)) we can see that `child.props` is accessed when `child` has the potential to be an invalid `React` element.

```js
ReactChildren.forEach(props.children, function (child, index) {
  if (child.props.value === props.selectedValue) {
    selectedIndex = index;
  }
  items.push({value: child.props.value, label: child.props.label});
});
```

This change ensures the incoming element is valid

```diff
ReactChildren.forEach(props.children, function (child, index) {
+ if (!React.isValidElement(child)) {
+   return;
+ }
  if (child.props.value === props.selectedValue) {
    selectedIndex = index;
  }
  items.
Closes https://github.com/facebook/react-native/pull/9243

Differential Revision: D3847514

Pulled By: spicyj

fbshipit-source-id: f46fbd4b0f81de7a92e1ca3e60b5ed15a9cbbf78
2016-09-10 21:43:37 -07:00
..
ART Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
ActionSheetIOS ActionSheetIOS - Pass URL, not file contents to UIActivityViewController for file URLs. 2016-09-06 04:43:36 -07:00
AdSupport Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
Animated Disables munging in animated to make dynamic dispatch work for private methods 2016-09-08 05:44:08 -07:00
AppRegistry Auto-fix lint errors 2016-08-09 06:43:46 -07:00
AppState Auto-fix lint errors 2016-08-09 06:43:46 -07:00
BatchedBridge Cleanup and document native module configuration 2016-09-08 04:13:51 -07:00
BugReporting Unrevert D3518381 2016-07-06 12:58:41 -07:00
CameraRoll Allow PhotoKit to download photos from iCloud 2016-09-08 16:28:35 -07:00
Components Bugfix - Only add valid IOSPicker items. 2016-09-10 21:43:37 -07:00
CustomComponents Added the PushFromLeft animation to Navigator 2016-09-09 06:28:34 -07:00
DebugComponentHierarchy Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
Devtools Get server host in setupDevtools for Android 2016-07-19 05:58:29 -07:00
EventEmitter Auto-fix lint errors 2016-08-09 06:43:46 -07:00
Experimental Use Batchinator in WindowedListView 2016-09-06 22:43:27 -07:00
Fetch Fixed what fetch.js exports 2016-07-14 11:13:27 -07:00
Geolocation Docs - explain how to access the geolocation API 2016-09-09 05:43:35 -07:00
Image Enable developers to force Fresco to resize an image 2016-09-09 05:13:53 -07:00
Inspector Auto-fix lint errors 2016-08-09 06:43:46 -07:00
Interaction Add some stall stuff as settings to native animated example 2016-09-06 19:58:35 -07:00
JavaScriptAppEngine Revert "Remove RCTLog from prod builds" 2016-09-09 05:43:35 -07:00
LayoutAnimation Auto-fix lint errors 2016-08-09 06:43:46 -07:00
Linking Auto-fix lint errors 2016-08-09 06:43:46 -07:00
LinkingIOS Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
Modal Allow <Modal /> to be presented in different orientations 2016-09-07 13:10:11 -07:00
NativeAnimation Add support for DiffClamp node 2016-09-06 15:43:35 -07:00
NavigationExperimental Deploy v0.32.0 2016-09-06 13:43:47 -07:00
Network For file uploads, don't stomp on developer's Content-Type header 2016-09-05 14:58:40 -07:00
PermissionsAndroid Change Android Permission Module to use promises 2016-08-16 12:58:39 -07:00
PushNotificationIOS registration error event 2016-09-06 11:13:40 -07:00
QuickPerformanceLogger AdsManager now uses new react native QPL identifiers 2016-07-20 07:28:36 -07:00
RCTTest Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
RKBackendNode Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
ReactIOS Deploy v0.32.0 2016-09-06 13:43:47 -07:00
ReactNative Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
Sample Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
Settings Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
Share Add Share module 2016-07-25 03:43:29 -07:00
Storage Auto-fix lint errors 2016-08-09 06:43:46 -07:00
StyleSheet re-enable and fix tests 2016-09-03 01:13:37 -07:00
Text Include CSSLayout.h consistently with other project includes 2016-09-06 09:13:39 -07:00
Utilities Move buildStyleInterpolator-test to open-source, remove unused files 2016-09-09 10:58:59 -07:00
Vibration Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
WebSocket Updating Websocket readyState in case of websocketFailed event 2016-09-08 17:13:45 -07:00
react-native Create a RTLExample for OSS 2016-08-18 20:58:39 -07:00
vendor Cleanup clear/set/throwImmediate 2016-08-12 07:28:38 -07:00
Promise.js Make onUnhandled safe for undefined errors 2016-08-02 07:58:28 -07:00
promiseRejectionIsError.js Add possibility to `console.error`/redbox on promise rejections 2016-03-15 05:22:22 -07:00