From 62cd3357883205135e92b859013ceaf973e2cb9f Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Mon, 13 Jun 2016 11:57:02 -0700 Subject: [PATCH] [fix] TouchableHighlight default underlay style --- src/components/Touchable/TouchableHighlight.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Touchable/TouchableHighlight.js b/src/components/Touchable/TouchableHighlight.js index b5713324..e33561a7 100644 --- a/src/components/Touchable/TouchableHighlight.js +++ b/src/components/Touchable/TouchableHighlight.js @@ -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 } } };