Home > Net >  Animated.View snaps back to original position instead of a slower transition
Animated.View snaps back to original position instead of a slower transition

Time:07-19

Here is the Snack demo: https://snack.expo.dev/@spk265/playful-ice-cream. As can be seen, the transition from L->R is smooth but R->L is not. How can I make the transition smooth in both directions?

CodePudding user response:

Try putting the animated value in a useRef so that it does not get recreated all the time

Example: https://snack.expo.dev/eZ4bmqavH

  • Related