3
votes

I'm using react-native-elements and I'm getting two same warnings, one for View and one for RCTView.

When I replace the Tile with something else (just a simple view) its fine.

The warnings are as below:

Warning: Failed prop type: Invalid props.style key 'resizeMode' supplied to 'RCTView'

Warning: Failed prop type: Invalid props.style key 'resizeMode' supplied to '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>
);
2
I don't see any reference to resizeMode in your code there, is it used elsewhere? does the parent component to your component above have a height set, or is it a flex container? According to facebook.github.io/react-native/docs/scrollview.html, the ScrollView component must have a bounded height in order to work.Finbarr O'B
It's a tab, thats the only thing I can think of. Thing is it worked fine up until yesterday...Doron Goldberg
@DoronGoldberg I'm seeing this same error for the first time today too... except I'm not using a tab anywhere in my app. I only see this error in ios, not android. Do you see this in both platforms?Turnipdabeets

2 Answers

2
votes

Solution found:

Edit

node_modules/react-native-elements/src/tile/Tile.js

Delete

resizeMode: 'cover'

from:

  imageContainer: {
      alignItems: 'center',
      justifyContent: 'center',
      resizeMode: 'cover',
      backgroundColor: '#ffffff',
      flex: 2,
    },
0
votes

Although deleting resizeMode will work, the proper answer is to pass it to the new prop, imageStyle.

The fix will be in the next version of react-native-elements:

Tile: Warning: Failed prop type: Invalid props.style key 'resizeMode' supplied to 'View'