withDelay
withDelay
is an animation modifier that lets you start an animation with a delay.
Reference
import { withDelay } from 'react-native-reanimated';
function App() {
sv.value = withDelay(500, withTiming(0));
// ...
}
Type definitions
type AnimatableValue = number | string | number[];
function withDelay<T extends AnimatableValue>(
delayMs: number,
delayedAnimation: T
): T;
Arguments
delayMs
Duration (in milliseconds) before the animation starts.
delayedAnimation
Animation to delay.
Returns
withDelay
returns an animation object. It can be either assigned directly to a shared value or can be used as a value for a style object returned from useAnimatedStyle.
Example
Loading...
Platform compatibility
Android | iOS | Web |
---|---|---|
✅ | ✅ | ✅ |