Warning: Failed prop type: Invalid propos.style 'resizeMode' supplied in 'RCTView'
I am using react-native-elements and I am getting two identical warnings, one for View and one for RCTView.
When I replace the Tile with something else (just a simple view), that's fine.
The warnings are as follows:
Warning: Failed prop type: Invalid props key .style 'resizeMode' supplied in "RCTView"
Warning: Failed prop type: Invalid prop key .style 'resizeMode' supplied in "View"
This is the problematic code:
return (
<ScrollView>
{events.map((event) => (
<Tile
key={event.event_id}
imageSrc={{ uri: event.picture.large }}
title={`${event.title.toUpperCase()}`}
onPress={() => this.onLearnMoreEvent(event)}
contentContainerStyle={{height: 80}}
>
<View style={{flex: 1, flexDirection: 'row', justifyContent: 'space-between'}}>
<Text>{`${event.location.city}, ${event.start_date} `}</Text>
<Text>Music</Text>
</View>
</Tile>
))}
</ScrollView>
);
+3
source to share
2 answers
While removing the resizeMode will work, the correct answer is to pass it to a new prop, imageStyle.
The fix will be in the following version of react-native-elements:
Tile: Warning: Failed prop type: Invalid key "resizeMode" props.style supplied in 'View'
0
source to share