mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-07 09:17:55 +08:00
[ReactNative] Fix TouchableOpacity crash when child props are missing
This commit is contained in:
@@ -106,7 +106,10 @@ var TouchableOpacity = React.createClass({
|
||||
},
|
||||
|
||||
touchableHandleActivePressOut: function() {
|
||||
var childStyle = flattenStyle(this.refs[CHILD_REF].props.style) || {};
|
||||
var childStyle = (
|
||||
this.refs[CHILD_REF].props &&
|
||||
flattenStyle(this.refs[CHILD_REF].props.style)
|
||||
) || {};
|
||||
this.setOpacityTo(childStyle.opacity === undefined ? 1 : childStyle.opacity);
|
||||
this.props.onPressOut && this.props.onPressOut();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user