Grokking React Native
0% completed
Using the Animated API with Gestures
The swipeable card from the previous lesson has two faults. A dismissed card vanishes in one frame, and a test that moves the finger 60 times renders the component 60 times. An animated value fixes both, because the finger can move the value directly, without state, and the release can start a timing or a spring from wherever the value is.
Connecting a Gesture to a Value
Animated.event builds a function that copies a number out of an event and into an animated value. You describe the shape of the event and put the value in the place of the number you want
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%