Skip to content

Commit efcdef7

Browse files
yungstersFacebook Github Bot
authored andcommitted
RN: Stop Deep Linking ReactChildren
Reviewed By: sebmarkbage Differential Revision: D4025469 fbshipit-source-id: 311f9d741101133155395355d8468938435063f7
1 parent edecbcd commit efcdef7

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Libraries/Components/Picker/PickerAndroid.android.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
var ColorPropType = require('ColorPropType');
1616
var React = require('React');
17-
var ReactChildren = require('react/lib/ReactChildren');
1817
var StyleSheet = require('StyleSheet');
1918
var StyleSheetPropType = require('StyleSheetPropType');
2019
var View = require('View');
@@ -79,7 +78,7 @@ class PickerAndroid extends React.Component {
7978
// Translate prop and children into stuff that the native picker understands.
8079
_stateFromProps = (props) => {
8180
var selectedIndex = 0;
82-
const items = ReactChildren.map(props.children, (child, index) => {
81+
const items = React.Children.map(props.children, (child, index) => {
8382
if (child.props.value === props.selectedValue) {
8483
selectedIndex = index;
8584
}

Libraries/Components/Picker/PickerIOS.ios.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
1616
var React = require('React');
17-
var ReactChildren = require('react/lib/ReactChildren');
1817
var StyleSheet = require('StyleSheet');
1918
var StyleSheetPropType = require('StyleSheetPropType');
2019
var TextStylePropTypes = require('TextStylePropTypes');
@@ -45,7 +44,7 @@ var PickerIOS = React.createClass({
4544
_stateFromProps: function(props) {
4645
var selectedIndex = 0;
4746
var items = [];
48-
ReactChildren.toArray(props.children).forEach(function (child, index) {
47+
React.Children.toArray(props.children).forEach(function (child, index) {
4948
if (child.props.value === props.selectedValue) {
5049
selectedIndex = index;
5150
}

Libraries/Components/TextInput/TextInput.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
1818
const Platform = require('Platform');
1919
const React = require('React');
2020
const ReactNative = require('ReactNative');
21-
const ReactChildren = require('react/lib/ReactChildren');
2221
const StyleSheet = require('StyleSheet');
2322
const Text = require('Text');
2423
const TextInputState = require('TextInputState');
@@ -621,7 +620,7 @@ const TextInput = React.createClass({
621620
} else {
622621
var children = props.children;
623622
var childCount = 0;
624-
ReactChildren.forEach(children, () => ++childCount);
623+
React.Children.forEach(children, () => ++childCount);
625624
invariant(
626625
!(props.value && childCount),
627626
'Cannot specify both value and children.'
@@ -670,7 +669,7 @@ const TextInput = React.createClass({
670669
UIManager.AndroidTextInput.Constants.AutoCapitalizationType[this.props.autoCapitalize];
671670
var children = this.props.children;
672671
var childCount = 0;
673-
ReactChildren.forEach(children, () => ++childCount);
672+
React.Children.forEach(children, () => ++childCount);
674673
invariant(
675674
!(this.props.value && childCount),
676675
'Cannot specify both value and children.'

0 commit comments

Comments
 (0)