How to Make Flatlist Rerender without changing the Data

Last Updated on March 19, 2019.

Flatlist is one of the most used components in React Native. It is super easy to implement and performs better than components like Listview. Flatlist is fully cross platform and it has cool features such as header, footer, scroll to index, pull to refresh etc.

Sometimes, you might need to make the flatlist re-render but without changing the data. In this case you can use the Flatlist prop extraData.

For Example, you can pass extraData={this.state} to Flatlist and as a result any changes in the state will make the Flatlist rerender. If you want to have a toggle function to rerender flatlist, then you can look on this stackoverflow answer.

Leave a Reply

%d bloggers like this: