detecting change in animated value react native 1

detecting change in animated value react native

this.state.translateAnim.addListener(({value}) => this._value = value);

Here is what the above code is Doing:
1. We create a new Animated.Value(0) and assign it to this.state.translateAnim.
2. We create a new Animated.timing() and assign it to this.state.translateAnim.
3. We call start() on this.state.translateAnim.
4. We add a listener to this.state.translateAnim.

Similar Posts