mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-04 02:56:42 +00:00
[fix] TouchableHighlight default underlay style
This commit is contained in:
@@ -93,21 +93,22 @@ var TouchableHighlight = React.createClass({
|
|||||||
getDefaultProps: () => DEFAULT_PROPS,
|
getDefaultProps: () => DEFAULT_PROPS,
|
||||||
|
|
||||||
// Performance optimization to avoid constantly re-generating these objects.
|
// Performance optimization to avoid constantly re-generating these objects.
|
||||||
computeSyntheticState: function(props) {
|
computeSyntheticState: (props) => {
|
||||||
|
const { activeOpacity, style, underlayColor } = props;
|
||||||
return {
|
return {
|
||||||
activeProps: {
|
activeProps: {
|
||||||
style: {
|
style: {
|
||||||
opacity: props.activeOpacity,
|
opacity: activeOpacity,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
activeUnderlayProps: {
|
activeUnderlayProps: {
|
||||||
style: {
|
style: {
|
||||||
backgroundColor: props.underlayColor,
|
backgroundColor: underlayColor,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
underlayProps: {
|
underlayProps: {
|
||||||
style: {
|
style: {
|
||||||
backgroundColor: props.style.backgroundColor || null
|
backgroundColor: style && style.backgroundColor || null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user