From efcdef711eba82b2905d237ee9a3d094652c37ac Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Fri, 14 Oct 2016 18:50:19 -0700 Subject: [PATCH] RN: Stop Deep Linking `ReactChildren` Reviewed By: sebmarkbage Differential Revision: D4025469 fbshipit-source-id: 311f9d741101133155395355d8468938435063f7 --- Libraries/Components/Picker/PickerAndroid.android.js | 3 +-- Libraries/Components/Picker/PickerIOS.ios.js | 3 +-- Libraries/Components/TextInput/TextInput.js | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Libraries/Components/Picker/PickerAndroid.android.js b/Libraries/Components/Picker/PickerAndroid.android.js index 2c18175af33889..4c42c4e011a6c5 100644 --- a/Libraries/Components/Picker/PickerAndroid.android.js +++ b/Libraries/Components/Picker/PickerAndroid.android.js @@ -14,7 +14,6 @@ var ColorPropType = require('ColorPropType'); var React = require('React'); -var ReactChildren = require('react/lib/ReactChildren'); var StyleSheet = require('StyleSheet'); var StyleSheetPropType = require('StyleSheetPropType'); var View = require('View'); @@ -79,7 +78,7 @@ class PickerAndroid extends React.Component { // Translate prop and children into stuff that the native picker understands. _stateFromProps = (props) => { var selectedIndex = 0; - const items = ReactChildren.map(props.children, (child, index) => { + const items = React.Children.map(props.children, (child, index) => { if (child.props.value === props.selectedValue) { selectedIndex = index; } diff --git a/Libraries/Components/Picker/PickerIOS.ios.js b/Libraries/Components/Picker/PickerIOS.ios.js index 8141120bec2265..fb8cbd5110ebbe 100644 --- a/Libraries/Components/Picker/PickerIOS.ios.js +++ b/Libraries/Components/Picker/PickerIOS.ios.js @@ -14,7 +14,6 @@ var NativeMethodsMixin = require('react/lib/NativeMethodsMixin'); var React = require('React'); -var ReactChildren = require('react/lib/ReactChildren'); var StyleSheet = require('StyleSheet'); var StyleSheetPropType = require('StyleSheetPropType'); var TextStylePropTypes = require('TextStylePropTypes'); @@ -45,7 +44,7 @@ var PickerIOS = React.createClass({ _stateFromProps: function(props) { var selectedIndex = 0; var items = []; - ReactChildren.toArray(props.children).forEach(function (child, index) { + React.Children.toArray(props.children).forEach(function (child, index) { if (child.props.value === props.selectedValue) { selectedIndex = index; } diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 40ec23190af529..17292874bec972 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -18,7 +18,6 @@ const NativeMethodsMixin = require('react/lib/NativeMethodsMixin'); const Platform = require('Platform'); const React = require('React'); const ReactNative = require('ReactNative'); -const ReactChildren = require('react/lib/ReactChildren'); const StyleSheet = require('StyleSheet'); const Text = require('Text'); const TextInputState = require('TextInputState'); @@ -621,7 +620,7 @@ const TextInput = React.createClass({ } else { var children = props.children; var childCount = 0; - ReactChildren.forEach(children, () => ++childCount); + React.Children.forEach(children, () => ++childCount); invariant( !(props.value && childCount), 'Cannot specify both value and children.' @@ -670,7 +669,7 @@ const TextInput = React.createClass({ UIManager.AndroidTextInput.Constants.AutoCapitalizationType[this.props.autoCapitalize]; var children = this.props.children; var childCount = 0; - ReactChildren.forEach(children, () => ++childCount); + React.Children.forEach(children, () => ++childCount); invariant( !(this.props.value && childCount), 'Cannot specify both value and children.'