Why I animate the Animated.View with transform
style, it works.
But when I update some data (with useState
), the transformed
status will go back to the origin.
However, other style properties, like padding
, will keep the updated value.
Why and how to solve it?
Asked
Active
Viewed 113 times
0

Soul Clinic
- 1,189
- 12
- 18
-
Can you provide your code? – Leri Gogsadze Dec 20 '20 at 12:57
-
@LeriGogsadze Just using `new Animated.Value(0)` then `Animated.timing...` And I found it works as expected in Android(simulator)--it will keep the transformed status, but not in iOS! – Soul Clinic Dec 20 '20 at 20:00
-
1use **useRef** hook. – Leri Gogsadze Dec 20 '20 at 20:27
-
@LeriGogsadze Oh thanks it works! I am curious why does it work without useRef in Android... – Soul Clinic Dec 20 '20 at 21:42