webraptor / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
138 stars 84 forks source link

How to update cards #126

Open samadRopstam opened 9 months ago

samadRopstam commented 9 months ago

I have a scenario in which once all the cards are swiped api is called to increase the radius and get more cards. the array is updated and i can see new cards in the log but the render functions returns undefined and the cards are empty i have also tried swipRef?.current?.forceUpdate(); but thats doesn't work either. The only way to render these new cards is to reopen that screen and we are able to see the cards. Can some one please guide?

coyksdev commented 8 months ago

i have the same issue

samadRopstam commented 8 months ago

@coyksdev i found the solution for it you have to give key e.g key={cardsArray.length} and then you also have to call the api to get more users with onSwipedAll={getUsers}