diff --git a/Libraries/Touchable/TouchableHighlight.web.js b/Libraries/Touchable/TouchableHighlight.web.js index d58f0ff..a700e7e 100644 --- a/Libraries/Touchable/TouchableHighlight.web.js +++ b/Libraries/Touchable/TouchableHighlight.web.js @@ -17,6 +17,7 @@ import { Mixin as NativeMethodsMixin } from 'NativeMethodsMixin'; import StyleSheet from 'ReactStyleSheet'; import mixin from 'react-mixin'; import autobind from 'autobind-decorator'; +import flattenStyle from 'ReactFlattenStyle'; type Event = Object; @@ -38,6 +39,11 @@ var INACTIVE_UNDERLAY_PROPS = { style: StyleSheet.create({x: {backgroundColor: 'transparent'}}).x, }; +var DEFAULT_UNDERLAY_STYLE = { + ...DEFAULT_PROPS.style, + ...INACTIVE_UNDERLAY_PROPS.style +} + class TouchableHighlight extends Component { static propTypes = { ...TouchableWithoutFeedback.propTypes, @@ -78,11 +84,10 @@ class TouchableHighlight extends Component { backgroundColor: props.underlayColor, } }, - underlayStyle: [ - DEFAULT_PROPS.style, - INACTIVE_UNDERLAY_PROPS.style, - props.style, - ] + underlayStyle: flattenStyle([ + DEFAULT_UNDERLAY_STYLE, + props.style + ]) }; }