webraptor / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
126 stars 81 forks source link

Empty cards still tries to render ( From Previous Repo still issue ) #13

Open doozie-akshay opened 3 years ago

doozie-akshay commented 3 years ago

Card Index initializes with the maximum Card Index equal to the initial size of the cards Array. And if any element is deleted from cards Array or updated, it iterates over the same range of card indices, hence it will return undefined for items no longer present in Cards Array.

davidn333 commented 3 years ago

Add 'key' prop to Swiper component

For example:

<Swiper key={cards.length}

gfpacheco commented 3 years ago

I'm facing this exact issue, but the suggested fix makes the Swiper go back to the first card, any way to set the initial card index? Like if I want the swiper to render the first time starting from index 3?