Skip to content

Instantly share code, notes, and snippets.

@Karthik-B-06
Created May 17, 2021 07:29
Show Gist options
  • Save Karthik-B-06/cb8e080ebebdbadad07aaa6d2a6988fa to your computer and use it in GitHub Desktop.
Save Karthik-B-06/cb8e080ebebdbadad07aaa6d2a6988fa to your computer and use it in GitHub Desktop.
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