alexbrillant / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
1.56k stars 465 forks source link

Force an update to the Swiper content #262

Closed rvieracds closed 5 years ago

rvieracds commented 5 years ago

Hi everyone! I'm facing the following situation, maybe someone can help me. The issue is that I'm rendering the content of the swiper from props and the component card has some active buttons that have to be updated when the user dispatch an action, but if I update the props with redux actions the Swiper don't get aware with the new props updated and it doesn't re-render the card content.

I noticed that the Swiper calls the method shouldComponentUpdate but it returns false because the props.cardIndex === nextProps.cardIndex. But the prevProps are different from the new ones. Is there a prop like the extraData prop that use the FlatList to force a render??

So, what would you recommend? Thanks in advance.

jackimatin commented 2 years ago

hi did you fix it?