I have a situation where I need to pass both State and Props in the FlatList extraData.
I tried something like this but didn't work.
<FlatList
numColumns={1}
data={this.props.artists}
renderItem={this.renderArtistItem}
initialNumToRender={15}
keyExtractor={item => item.id}
extraData={(this.state, this.props.league)}
/>
How to do that?
try this:
<FlatList
numColumns={1}
data={this.props.artists}
renderItem={this.renderArtistItem}
initialNumToRender={15}
keyExtractor={item => item.id}
extraData={[this.state, this.props.league]}
/>
As it will work as an array in extra data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With