Closed elboboua closed 2 years ago
I believe there needs to be an extra check in this condition to ensure that the card length is long enough to handle a secondIndex. It is breaking when the length of the cards array is equal to 1.
https://github.com/tarasvakulka/react-native-cards-swipe/blob/0673b136104e77e7de2b6a82fe3b7c4e9e3530cb/src/components/CardsSwipe/index.tsx#L269
In some cases there will be only one card and this code will break. As a temporary fix, I included the following code in the renderCard function:
(card) => { if (!card) return; // my own render component }
Thanks for report, fixed in v1.2.1
I believe there needs to be an extra check in this condition to ensure that the card length is long enough to handle a secondIndex. It is breaking when the length of the cards array is equal to 1.
https://github.com/tarasvakulka/react-native-cards-swipe/blob/0673b136104e77e7de2b6a82fe3b7c4e9e3530cb/src/components/CardsSwipe/index.tsx#L269
In some cases there will be only one card and this code will break. As a temporary fix, I included the following code in the renderCard function: