mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-05 07:07:26 +08:00
RN: Change onlyChild => React.Children.only
Reviewed By: sebmarkbage Differential Revision: D4025440 fbshipit-source-id: efbcb44dcc89a6059688cf5a00cf28ada8a6a4c4
This commit is contained in:
committed by
Facebook Github Bot
parent
331c13d4dc
commit
c4fc13b997
@@ -19,7 +19,6 @@ var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
|
||||
var UIManager = require('UIManager');
|
||||
|
||||
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
|
||||
var onlyChild = require('react/lib/onlyChild');
|
||||
var processColor = require('processColor');
|
||||
var requireNativeComponent = require('requireNativeComponent');
|
||||
|
||||
@@ -222,7 +221,7 @@ var TouchableNativeFeedback = React.createClass({
|
||||
},
|
||||
|
||||
render: function() {
|
||||
const child = onlyChild(this.props.children);
|
||||
const child = React.Children.only(this.props.children);
|
||||
let children = child.props.children;
|
||||
if (Touchable.TOUCH_TARGET_DEBUG && child.type.displayName === 'View') {
|
||||
if (!Array.isArray(children)) {
|
||||
|
||||
Reference in New Issue
Block a user