Hello, I'm lazy loading in forward and reverse. Initially, cards and cardIndex come from pieces of redux state.
When the state changes, the component is rendered again.
When the state changes to an array with new cards added to the end it works fine, my swiper has some new cards to swipe through, maybe because the index doesn't effectively change at this point.
However, when the state changes to an array with new cards added to the beginning, the cardIndex has to be adjusted of course, but cardIndex seems to be ignored when the render happens (after the first render).
Since redux will return a new array in the state and render will run, there doesn't seem to be an opportunity to use jumpToCardIndex anywhere in render(), unless I'm overlooking some different strategy of doing this?
Why do you need to add cards at the beginning of the array ?
There's a really large collection of items in a flat list, and you can select one to see the large version of it, and then the user can swipe through the collection moving either left or right, having started from any point.
componentWillReceiveProps now calculates the right card indexes
Amazing news thank you so much
Most helpful comment
componentWillReceiveProps now calculates the right card indexes