React-native-snap-carousel: How to rerender an item?

Created on 25 May 2018  路  2Comments  路  Source: meliorence/react-native-snap-carousel

I have some cards with buttons on them. When the buttons pressed the cards need rerendering as the information on them will change according to the button press. How could I trigger this rerender - ideally such that only the impacted card gets rerendere?

Thanks!

contribution? reproduction?

Most helpful comment

鈿狅笍 You did not follow the contributing guidelines!

As stated in these:

You need to fill out the issue template. This step is mandatory! Not doing so will result in your issue getting closed. Don't take this personally if this happens, and feel free to open a new issue once you've gathered all the information required by the template.


Regarding your question, and since the Carousel component extends the FlatList one, you can try to use prop extraData={this.state} and see if this solves your issue. You can take a look at the RN doc for more info.

Note that this has already been mentioned in #133 and #180.

All 2 comments

鈿狅笍 You did not follow the contributing guidelines!

As stated in these:

You need to fill out the issue template. This step is mandatory! Not doing so will result in your issue getting closed. Don't take this personally if this happens, and feel free to open a new issue once you've gathered all the information required by the template.


Regarding your question, and since the Carousel component extends the FlatList one, you can try to use prop extraData={this.state} and see if this solves your issue. You can take a look at the RN doc for more info.

Note that this has already been mentioned in #133 and #180.

It helped thanks!

Was this page helpful?
0 / 5 - 0 ratings