cardIndex trick mentioned in the docs doesn't seem to work either. Swiper doesn't rerender when new cards are added to the list. Here's what i've done:
I've searched for a possible solution in the original repo and found a working PR. For everyone who wants dynamic cards list to work, I suggest you update the package locally with the mentioned PR. If maintainer will approve this solution, I will open a PR so this feature could be added ASAP.
Issue
I was trying to implement a dynamic deck swiper using key={cards.length} approach found here, but faced a ReferenceError when cards data was updated.
Setup:
react-native-deck-swiper: 2.0.10 react-native: 0.68.0 react: 17.0.2
Fix
Adding this before componentWillUnmountAfterInteractions inside componentWillUnmount fixes the problem.
I can introduce a PR if needed.
Thanks for your work
UPD
cardIndex trick mentioned in the docs doesn't seem to work either. Swiper doesn't rerender when new cards are added to the list. Here's what i've done:
UPD2
I've searched for a possible solution in the original repo and found a working PR. For everyone who wants dynamic cards list to work, I suggest you update the package locally with the mentioned PR. If maintainer will approve this solution, I will open a PR so this feature could be added ASAP.