[react-native] In TouchableOpacity, access .props on element, not component

This commit is contained in:
Ben Alpert 2015-05-08 08:26:29 -07:00
parent ec9015d005
commit 5e51fac8d5
1 changed files with 2 additions and 4 deletions

View File

@ -106,10 +106,8 @@ var TouchableOpacity = React.createClass({
},
touchableHandleActivePressOut: function() {
var childStyle = (
this.refs[CHILD_REF].props &&
flattenStyle(this.refs[CHILD_REF].props.style)
) || {};
var child = onlyChild(this.props.children);
var childStyle = flattenStyle(child.props.style) || {};
this.setOpacityTo(childStyle.opacity === undefined ? 1 : childStyle.opacity);
this.props.onPressOut && this.props.onPressOut();
},