Skip to content

Commit

Permalink
RN: Stop Deep Linking ReactChildren
Browse files Browse the repository at this point in the history
Reviewed By: sebmarkbage

Differential Revision: D4025469

fbshipit-source-id: 311f9d741101133155395355d8468938435063f7
  • Loading branch information
yungsters authored and Facebook Github Bot committed Oct 15, 2016
1 parent edecbcd commit efcdef7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Libraries/Components/Picker/PickerAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions Libraries/Components/Picker/PickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}
Expand Down
5 changes: 2 additions & 3 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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.'
Expand Down Expand Up @@ -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.'
Expand Down

0 comments on commit efcdef7

Please sign in to comment.