withSpring
withSpring
lets you create spring-based animations.
Loading...
Reference
import { withSpring } from 'react-native-reanimated';
function App() {
sv.value = withSpring(0);
// ...
}


Type definitions
type AnimatableValue = number | string | number[];
interface WithSpringConfig {
damping?: number;
mass?: number;
stiffness?: number;
overshootClamping?: boolean;
restSpeedThreshold?: number;
restDisplacementThreshold?: number;
velocity?: number;
reduceMotion?: ReduceMotion;
clamp?: [number, number];
}
function withSpring<T extends AnimatableValue>(
toValue: T,
config?: WithSpringConfig,
callback?: (finished?: boolean, current?: AnimatableValue) => void
): T;
enum ReduceMotion {
System = 'system',
Always = 'always',
Never = 'never',
}