react-native: undefined is not an object (evaluting 'validAttributes.style')
here is the code :
const style = {
marginTop: 11.8,
marginLeft: marginLeft,
marginRight: marginRight,
width: width
};
/// ...
itemviews.push(
<TouchableHighlight
underlayColor="#00000000"
key={i}
style={style}
onPress={this.onPressunCoverList.bind(this, moneyDict.gameId, moneyDict.userName)}>
<Image
style={[styles.noredimageStyle, {width: width}]}
source={require('../../image/noRedPacket.png')}/>
</TouchableHighlight>
)
If i click the Image on a android device, it will show this: “undefined is not an object (evaluting ‘validAttributes.style’)”, but iOS device is ok.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (8 by maintainers)
Finally I founded case, for reproduce tis issue.
This construction will cause an error on Android:
But, This construction works well on both:
Question, why TouchableHighlight cause an error?