React Native FlatList won't render until I scroll
javascript, react-native
Solution
I solved by using this on my FlatList: `extraData={this.state}` this way, FlatList knows it has to re-render.
It's in the docs.
Problem
On my Main Screen I have some search parameters that an user can choose from, like brand and price. If I select any of them and press search it send the data to the Second Screen, to show the list, but It won't render until I scroll on it. But if I search without setting any parameters it shows the list correctly. Since Im sending the parameters to another screen I thought it should re-render. The same happens with my sort filters... When I'm on the list, if I select "sorte by price" it won't re-render until I scroll again... What am I doing wrong? EDIT: im not alone: https://github.com/facebook/react-native/issues/13316 Setting removeClippedSubviews={false} fixes the initial search, but the sort filters are still not working.