mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 15:45:32 +00:00
RN: Stop Deep Linking ReactChildren
Reviewed By: sebmarkbage Differential Revision: D4025469 fbshipit-source-id: 311f9d741101133155395355d8468938435063f7
This commit is contained in:
parent
edecbcddcc
commit
efcdef711e
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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.'
|
||||
|
Loading…
x
Reference in New Issue
Block a user