Created
May 17, 2021 07:29
-
-
Save Karthik-B-06/cb8e080ebebdbadad07aaa6d2a6988fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| onHandlerStateChange={(event) => { | |
| if (event.nativeEvent.state === State.BEGAN) { | |
| spring(springValue, { | |
| toValue: 1, | |
| mass: 1, | |
| damping: 20, | |
| stiffness: 150, | |
| overshootClamping: false, | |
| restSpeedThreshold: 0.001, | |
| restDisplacementThreshold: 0.001, | |
| }).start(); | |
| } else if (event.nativeEvent.state === State.END) { | |
| spring(springValue, { | |
| toValue: 0, | |
| mass: 1, | |
| damping: 20, | |
| stiffness: 150, | |
| overshootClamping: false, | |
| restSpeedThreshold: 0.001, | |
| restDisplacementThreshold: 0.001, | |
| }).start(); | |
| // A function you want to perform on gesture end | |
| } else { | |
| spring(springValue, { | |
| toValue: 0, | |
| mass: 1, | |
| damping: 20, | |
| stiffness: 150, | |
| overshootClamping: false, | |
| restSpeedThreshold: 0.001, | |
| restDisplacementThreshold: 0.001, | |
| }).start(); | |
| } | |
| }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment