Closed legaciespanda closed 3 years ago
Looks like you have undefined cards. Try using a debugger in your card rendering method to see what are the card contents prior to throwing the error.
Alternatively you can update the card method to return card && (cardContent) || null which should fix the rendering issue if you get undefined or null cards.
Thanks @webraptor I was able to solve the problem with the code below
renderCard={(card) => (card && <Cardz card={card} />) || null}
Thanks, i have solved the issue. Issue closed
On Sat, 9 Jan 2021 at 05:54, Bogdan Pop notifications@github.com wrote:
Looks like you have undefined cards. Try using a debugger in your card rendering method to see what are the card contents prior to throwing the error.
Alternatively you can update the card method to return card && (cardContent) || null which should fix the rendering issue if you get undefined or null cards.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexbrillant/react-native-deck-swiper/issues/342#issuecomment-757096485, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBFKNVJ5RFOBKZGUK3JO5DSY7ORTANCNFSM4V22WT7A .
When I fetch data from an API and save in the state array. When I try to use the data saved in the state. It shows me the error above.
The issue is on stack overflow https://stackoverflow.com/questions/65606216/react-native-deck-swiper