[fix] TouchableHighlight default underlay style

This commit is contained in:
Nicolas Gallagher
2016-06-13 11:57:02 -07:00
parent 288e14cd70
commit 62cd335788
@@ -93,21 +93,22 @@ var TouchableHighlight = React.createClass({
getDefaultProps: () => DEFAULT_PROPS,
// Performance optimization to avoid constantly re-generating these objects.
computeSyntheticState: function(props) {
computeSyntheticState: (props) => {
const { activeOpacity, style, underlayColor } = props;
return {
activeProps: {
style: {
opacity: props.activeOpacity,
opacity: activeOpacity,
}
},
activeUnderlayProps: {
style: {
backgroundColor: props.underlayColor,
backgroundColor: underlayColor,
}
},
underlayProps: {
style: {
backgroundColor: props.style.backgroundColor || null
backgroundColor: style && style.backgroundColor || null
}
}
};