alexbrillant / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
1.55k stars 461 forks source link

Stuttering performance due to state update #336

Open johnfrancisgit opened 3 years ago

johnfrancisgit commented 3 years ago

The swiper has poor performance / stutters when moving because the the panResponder updates the overlay direction in state for the whole swiper component - causing the whole component to be rerendered mid-movement. Can we extrapolate the overlay outside of the swiper component / state?

webraptor commented 3 years ago

Moving the overlay outside of the swiper wouldn't improve the overall performance and it would complicate pretty much everything as the pan responder would have to be passed as a reference so that developers could implement their own overlay labels if they wish to.

However, overlay labels are ignored all together if they are not present so they shouldn't affect performance. [reference here]