The ref of the React Native Snap Carousel package is becoming null on re rendering the same component with different params.
What I have tried till now Since the package used react native flatlist as its implementation, so i modified my code to the flatlist view and that shows no error
Here are some of the logs of what happens Object - > Navigate - > Null - > Object
I've just released version 3.3.0 of the plugin today, which should solve your issue.
If you want a deeper understanding of the issue at stake, see this React Native thread. Basically, one should apparently avoid using stateless components when rendered inside scroll components. They should be migrated to regular components that extend Component
or PureComponent
. See this comment or this one.
Also, it seems that Animated
components are sometimes unmounted before their parents...