Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
this.state.bounceValue.setValue(1.5);
Animated.spring(
this.state.bounceValue,
{
toValue: 0.8,
friction: 1,
}
).start();
this.state.rotateValue.setValue(125);
Animated.spring(
this.state.rotateValue,
{
toValue: 0,
friction: 1,
}
).start();
_reset(velocity: number): void {
const props = this._props;
Animated.spring(
props.position,
{
toValue: props.navigationState.index,
duration: ANIMATION_DURATION,
useNativeDriver: props.position.__isNative,
velocity: velocity * GESTURE_ANIMATED_VELOCITY_RATIO,
bounciness: 0,
}
).start();
}
_handlePanResponderGrant = (e, gestureState) => {
this.state.pan.setOffset({x: this.state.pan.x._value, y: this.state.pan.y._value});
this.state.pan.setValue({x: 0, y: 0});
Animated.spring(
this.state.scale,
{ toValue: 1.1, friction: 3 }
).start();
};
_goBack(velocity: number) {
const props = this._props;
if (!props.onNavigateBack) {
return;
}
Animated.spring(
props.position,
{
toValue: Math.max(props.navigationState.index - 1, 0),
duration: ANIMATION_DURATION,
useNativeDriver: props.position.__isNative,
velocity: velocity * GESTURE_ANIMATED_VELOCITY_RATIO,
bounciness: 0,
}
).start(props.onNavigateBack);
}
componentDidMount() {
this.state.bounceValue.setValue(1.5);
Animated.spring(
this.state.bounceValue,
{
toValue: 0.8,
friction: 1,
}
).start();
this.state.rotateValue.setValue(125);
Animated.spring(
this.state.rotateValue,
{
toValue: 0,
friction: 1,
}
).start();
}
}