2017-11-08 00:34:50 +00:00
---
id: animated
title: Animated
layout: docs
category: APIs
permalink: docs/animated.html
2017-11-20 21:07:10 +00:00
next: animatedvalue
2017-11-08 00:34:50 +00:00
previous: alertios
---
2017-11-20 21:07:10 +00:00
The `Animated` library is designed to make animations fluid, powerful, and easy to build and maintain. `Animated` focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and simple `start` /`stop` methods to control time-based animation execution.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
The simplest workflow for creating an animation is to create an `Animated.Value` , hook it up to one or more style attributes of an animated component, and then drive updates via animations using `Animated.timing()` :
2017-11-08 00:34:50 +00:00
```javascript
Animated.timing( // Animate value over time
this.state.fadeAnim, // The value to drive
{
toValue: 1, // Animate to final value of 1
}
).start(); // Start the animation
```
2017-11-20 21:07:10 +00:00
Refer to the [Animations ](docs/animations.html#animated-api ) guide to see additional examples of `Animated` in action.
2017-11-08 00:34:50 +00:00
## Overview
There are two value types you can use with `Animated` :
2017-11-20 21:07:10 +00:00
- [`Animated.Value()` ](docs/animatedvalue.html ) for single values
- [`Animated.ValueXY()` ](docs/animatedvaluexy.html ) for vectors
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
`Animated.Value` can bind to style properties or other props, and can be interpolated as well. A single `Animated.Value` can drive any number of properties.
2017-11-08 00:34:50 +00:00
### Configuring animations
2017-11-20 21:07:10 +00:00
`Animated` provides three types of animation types. Each animation type provides a particular animation curve that controls how your values animate from their initial value to the final value:
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
- [`Animated.decay()` ](docs/animated.html#decay ) starts with an initial velocity and gradually slows to a stop.
- [`Animated.spring()` ](docs/animated.html#spring ) provides a simple spring physics model.
- [`Animated.timing()` ](docs/animated.html#timing ) animates a value over time using [easing functions ](docs/easing.html ).
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
In most cases, you will be using `timing()` . By default, it uses a symmetric easeInOut curve that conveys the gradual acceleration of an object to full speed and concludes by gradually decelerating to a stop.
2017-11-08 00:34:50 +00:00
### Working with animations
2017-11-20 21:07:10 +00:00
Animations are started by calling `start()` on your animation. `start()` takes a completion callback that will be called when the animation is done. If the animation finished running normally, the completion callback will be invoked with `{finished: true}` . If the animation is done because `stop()` was called on it before it could finish (e.g. because it was interrupted by a gesture or another animation), then it will receive `{finished: false}` .
2017-11-08 00:34:50 +00:00
### Using the native driver
2017-11-20 21:07:10 +00:00
By using the native driver, we send everything about the animation to native before starting the animation, allowing native code to perform the animation on the UI thread without having to go through the bridge on every frame. Once the animation has started, the JS thread can be blocked without affecting the animation.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
You can use the native driver by specifying `useNativeDriver: true` in your animation configuration. See the [Animations ](docs/animations.html#using-the-native-driver ) guide to learn more.
2017-11-08 00:34:50 +00:00
### Animatable components
2017-11-20 21:07:10 +00:00
Only animatable components can be animated. These special components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
- [`createAnimatedComponent()` ](docs/animated.html#createanimatedcomponent ) can be used to make a component animatable.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
`Animated` exports the following animatable components using the above wrapper:
2017-11-08 00:34:50 +00:00
- `Animated.Image`
- `Animated.ScrollView`
- `Animated.Text`
- `Animated.View`
### Composing animations
Animations can also be combined in complex ways using composition functions:
2017-11-20 21:07:10 +00:00
- [`Animated.delay()` ](docs/animated.html#delay ) starts an animation after a given delay.
- [`Animated.parallel()` ](docs/animated.html#parallel ) starts a number of animations at the same time.
- [`Animated.sequence()` ](docs/animated.html#sequence ) starts the animations in order, waiting for each to complete before starting the next.
- [`Animated.stagger()` ](docs/animated.html#stagger ) starts animations in order and in parallel, but with successive delays.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Animations can also be chained together simply by setting the `toValue` of one animation to be another `Animated.Value` . See [Tracking dynamic values ](docs/animations.html#tracking-dynamic-values ) in the Animations guide.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
By default, if one animation is stopped or interrupted, then all other animations in the group are also stopped.
2017-11-08 00:34:50 +00:00
### Combining animated values
2017-11-20 21:07:10 +00:00
You can combine two animated values via addition, multiplication, division, or modulo to make a new animated value:
2017-11-08 00:34:50 +00:00
- [`Animated.add()` ](docs/animated.html#add )
- [`Animated.divide()` ](docs/animated.html#divide )
- [`Animated.modulo()` ](docs/animated.html#modulo )
- [`Animated.multiply()` ](docs/animated.html#multiply )
### Interpolation
2017-11-20 21:07:10 +00:00
The `interpolate()` function allows input ranges to map to different output ranges. By default, it will extrapolate the curve beyond the ranges given, but you can also have it clamp the output value. It uses lineal interpolation by default but also supports easing functions.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
- [`interpolate()` ](docs/animatedvalue.html#interpolate )
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Read more about interpolation in the [Animation ](docs/animations.html#interpolation ) guide.
2017-11-08 00:34:50 +00:00
### Handling gestures and other events
2017-11-20 21:07:10 +00:00
Gestures, like panning or scrolling, and other events can map directly to animated values using `Animated.event()` . This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
2017-11-08 00:34:50 +00:00
- [`Animated.event()` ](docs/animated.html#event )
2017-11-20 21:07:10 +00:00
For example, when working with horizontal scrolling gestures, you would do the following in order to map `event.nativeEvent.contentOffset.x` to `scrollX` (an `Animated.Value` ):
2017-11-08 00:34:50 +00:00
```javascript
onScroll={Animated.event(
// scrollX = e.nativeEvent.contentOffset.x
[{ nativeEvent: {
contentOffset: {
x: scrollX
}
}
}]
)}
```
2017-11-20 21:07:10 +00:00
### Methods
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
#### Configuring animations
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
- [`decay()` ](docs/animated.html#decay )
- [`timing()` ](docs/animated.html#timing )
- [`spring()` ](docs/animated.html#spring )
#### Combining animated values
2017-11-08 00:34:50 +00:00
- [`add` ](docs/animated.html#add )
- [`divide` ](docs/animated.html#divide )
- [`multiply` ](docs/animated.html#multiply )
- [`modulo` ](docs/animated.html#modulo )
- [`diffClamp` ](docs/animated.html#diffclamp )
2017-11-20 21:07:10 +00:00
#### Composing animations
2017-11-08 00:34:50 +00:00
- [`delay` ](docs/animated.html#delay )
- [`sequence` ](docs/animated.html#sequence )
- [`parallel` ](docs/animated.html#parallel )
- [`stagger` ](docs/animated.html#stagger )
2017-11-20 21:07:10 +00:00
#### Handling gestures and other events
2017-11-08 00:34:50 +00:00
- [`event` ](docs/animated.html#event )
2017-11-20 21:07:10 +00:00
- [`attachNativeEvent` ](docs/animated.html#attachnativeevent )
2017-11-08 00:34:50 +00:00
- [`forkEvent` ](docs/animated.html#forkevent )
- [`unforkEvent` ](docs/animated.html#unforkevent )
2017-11-20 21:07:10 +00:00
#### Others
- [`loop` ](docs/animated.html#loop )
- [`createAnimatedComponent` ](docs/animated.html#createanimatedcomponent )
2017-11-08 00:34:50 +00:00
### Properties
- [`Value` ](docs/animated.html#value )
- [`ValueXY` ](docs/animated.html#valuexy )
- [`Interpolation` ](docs/animated.html#interpolation )
- [`Node` ](docs/animated.html#node )
---
# Reference
## Methods
### `decay()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.decay(value, config)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Animates a value from an initial velocity to zero based on a decay coefficient.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| value | AnimatedValue or AnimatedValueXY | Yes | Value to animate. |
| config | object | Yes | See below. |
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Config is an object that may have the following options:
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
- `velocity` : Initial velocity. Required.
- `deceleration` : Rate of decay. Default 0.997.
- `isInteraction` : Whether or not this animation creates an "interaction handle" on the
`InteractionManager` . Default true.
- `useNativeDriver` : Uses the native driver when true. Default false.
2017-11-08 00:34:50 +00:00
---
### `timing()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.timing(value, config)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Animates a value along a timed easing curve. The [`Easing` ](docs/easing.html ) module has tons of predefined curves, or you can use your own function.
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| value | AnimatedValue or AnimatedValueXY | Yes | Value to animate. |
| config | object | Yes | See below. |
2017-11-08 00:34:50 +00:00
Config is an object that may have the following options:
- `duration` : Length of animation (milliseconds). Default 500.
- `easing` : Easing function to define curve.
Default is `Easing.inOut(Easing.ease)` .
- `delay` : Start the animation after delay (milliseconds). Default 0.
- `isInteraction` : Whether or not this animation creates an "interaction handle" on the
`InteractionManager` . Default true.
- `useNativeDriver` : Uses the native driver when true. Default false.
---
### `spring()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.spring(value, config)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Animates a value according to an analytical spring model based on [damped harmonic oscillation ](https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator ). Tracks velocity state to create fluid motions as the `toValue` updates, and can be chained together.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| value | AnimatedValue or AnimatedValueXY | Yes | Value to animate. |
| config | object | Yes | See below. |
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
`config` is an object that may have the following options.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Note that you can only define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one:
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
The friction/tension or bounciness/speed options match the spring model in [Facebook Pop ](https://github.com/facebook/pop ), [Rebound ](http://facebook.github.io/rebound/ ), and [Origami ](http://origami.design/ ).
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
- `friction` : Controls "bounciness"/overshoot. Default 7.
- `tension` : Controls speed. Default 40.
- `speed` : Controls speed of the animation. Default 12.
- `bounciness` : Controls bounciness. Default 8.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Specifying stiffness/damping/mass as parameters makes `Animated.spring` use an analytical spring model based on the motion equations of a [damped harmonic oscillator ](https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator ). This behavior is slightly more precise and faithful to the physics behind spring dynamics, and closely mimics the implementation in iOS's CASpringAnimation primitive.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
- `stiffness` : The spring stiffness coefficient. Default 100.
- `damping` : Defines how the spring’ s motion should be damped due to the forces of friction. Default 10.
- `mass` : The mass of the object attached to the end of the spring. Default 1.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Other configuration options are as follows:
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
- `velocity` : The initial velocity of the object attached to the spring. Default 0 (object is at rest).
- `overshootClamping` : Boolean indiciating whether the spring should be clamped and not bounce. Default false.
- `restDisplacementThreshold` : The threshold of displacement from rest below which the spring should be considered at rest. Default 0.001.
- `restSpeedThreshold` : The speed at which the spring should be considered at rest in pixels per second. Default 0.001.
- `delay` : Start the animation after delay (milliseconds). Default 0.
- `isInteraction` : Whether or not this animation creates an "interaction handle" on the `InteractionManager` . Default true.
- `useNativeDriver` : Uses the native driver when true. Default false.
2017-11-08 00:34:50 +00:00
---
### `add()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.add(a, b)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Creates a new Animated value composed from two Animated values added together.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| a | AnimatedValue | Yes | Operand. |
| b | AnimatedValue | Yes | Operand. |
2017-11-08 00:34:50 +00:00
---
### `divide()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.divide(a, b)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Creates a new Animated value composed by dividing the first Animated value by the second Animated value.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| a | AnimatedValue | Yes | Operand. |
| b | AnimatedValue | Yes | Operand. |
2017-11-08 00:34:50 +00:00
---
### `multiply()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.multiply(a, b)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Creates a new Animated value composed from two Animated values multiplied together.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| a | AnimatedValue | Yes | Operand. |
| b | AnimatedValue | Yes | Operand. |
2017-11-08 00:34:50 +00:00
---
### `modulo()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.modulo(a, modulus)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Creates a new Animated value that is the (non-negative) modulo of the provided Animated value.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| a | AnimatedValue | Yes | Operand. |
| modulus | AnimatedValue | Yes | Operand. |
2017-11-08 00:34:50 +00:00
---
### `diffClamp()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.diffClamp(a, min, max)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Create a new Animated value that is limited between 2 values. It uses the difference between the last value so even if the value is far from the bounds it will start changing when the value starts getting closer again. (`value = clamp(value + diff, min, max)`).
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
This is useful with scroll events, for example, to show the navbar when scrolling up and to hide it when scrolling down.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| a | AnimatedValue | Yes | Operand. |
| min | number | Yes | Minimum value. |
| max | number | Yes | Maximum value. |
2017-11-08 00:34:50 +00:00
---
### `delay()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.delay(time)
2017-11-08 00:34:50 +00:00
```
Starts an animation after the given delay.
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| time | number | Yes | Delay in milliseconds. |
2017-11-08 00:34:50 +00:00
---
### `sequence()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.sequence(animations)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Starts an array of animations in order, waiting for each to complete before starting the next. If the current running animation is stopped, no following animations will be started.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| animations | array | Yes | Array of animations. |
2017-11-08 00:34:50 +00:00
---
### `parallel()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.parallel(animations, [config])
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Starts an array of animations all at the same time. By default, if one
of the animations is stopped, they will all be stopped. You can override
this with the `stopTogether` flag through `config` .
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| animations | array | Yes | Array of animations. |
| config | object | No | An object with a `stopTogether` key (boolean). |
2017-11-08 00:34:50 +00:00
---
### `stagger()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.stagger(time, animations)
2017-11-08 00:34:50 +00:00
```
Array of animations may run in parallel (overlap), but are started in
sequence with successive delays. Nice for doing trailing effects.
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| time | number | Yes | Delay in milliseconds. |
| animations | array | Yes | Array of animations. |
2017-11-08 00:34:50 +00:00
---
### `loop()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.loop(animation)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Loops a given animation continuously, so that each time it reaches the end, it resets and begins again from the start. Can specify number of times to loop using the key `iterations` in the config. Will loop without blocking the UI thread if the child animation is set to `useNativeDriver: true` . In addition, loops can prevent `VirtualizedList` -based components from rendering more rows while the animation is running. You can pass `isInteraction: false` in the child animation config to fix this.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| animation | animation | Yes | Animation to loop. |
2017-11-08 00:34:50 +00:00
---
### `event()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.event(argMapping, [config])
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Takes an array of mappings and extracts values from each arg accordingly, then calls `setValue` on the mapped outputs. e.g.
2017-11-08 00:34:50 +00:00
```javascript
2017-11-20 21:07:10 +00:00
onScroll={Animated.event(
[{nativeEvent: {contentOffset: {x: this._scrollX}}}],
{listener: (event) => console.log(event)}, // Optional async listener
)}
...
onPanResponderMove: Animated.event([
null, // raw event arg ignored
{dx: this._panX}, // gestureState arg
{listener: (event, gestureState) => console.log(event, gestureState)}, // Optional async listener
]),
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
**Parameters:**
| Name | Type | Required | Description |
| - | - | - | - |
| argMapping | array | Yes | Array of mappings. |
| config | object | No | See below. |
2017-11-08 00:34:50 +00:00
Config is an object that may have the following options:
2017-11-20 21:07:10 +00:00
- `listener` : Optional async listener.
- `useNativeDriver` : Uses the native driver when true. Default false.
---
### `createAnimatedComponent()`
```javascript
createAnimatedComponent(component)
```
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Make any React component Animatable. Used to create `Animated.View` , etc.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| component | component | Yes | React component |
2017-11-08 00:34:50 +00:00
---
2017-11-20 21:07:10 +00:00
### `attachNativeEvent()`
2017-11-08 00:34:50 +00:00
```javascript
2017-11-20 21:07:10 +00:00
attachNativeEvent(viewRef, eventName, argMapping)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Imperative API to attach an animated value to an event on a view. Prefer using `Animated.event` with `useNativeDrive: true` if possible.
**Parameters:**
| Name | Type | Required | Description |
| - | - | - | - |
| viewRef | any | Yes | View reference. |
| eventName | string | Yes | Event name. |
| argMapping | array | Yes | Array of mappings. |
---
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
### `forkEvent()`
```javascript
Animated.forkEvent(event, listener)
```
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Advanced imperative API for snooping on animated events that are passed in through props. Use values directly where possible.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| event | event or function | Yes | Event. |
| listener | function | Yes | Handler. |
2017-11-08 00:34:50 +00:00
---
### `unforkEvent()`
```javascript
2017-11-20 21:07:10 +00:00
Animated.unforkEvent(event, listener)
2017-11-08 00:34:50 +00:00
```
2017-11-20 21:07:10 +00:00
Advanced imperative API for snooping on animated events that are passed in through props. Use values directly where possible.
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
**Parameters:**
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
| Name | Type | Required | Description |
| - | - | - | - |
| event | event or function | Yes | Event. |
| listener | function | Yes | Handler. |
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
## Properties
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
### Value
2017-11-08 00:34:50 +00:00
2017-11-20 21:07:10 +00:00
Standard value for driving animations.
2017-11-08 00:34:50 +00:00
2017-11-09 17:47:50 +00:00
| Type |
| - |
2017-11-20 21:07:10 +00:00
| [`AnimatedValue` ](docs/animatedvalue.html ) |
2017-11-08 00:34:50 +00:00
---
2017-11-09 17:47:50 +00:00
### ValueXY
2017-11-08 00:34:50 +00:00
2017-11-09 17:47:50 +00:00
2D value class for driving 2D animations, such as pan gestures.
2017-11-08 00:34:50 +00:00
2017-11-09 17:47:50 +00:00
| Type |
| - |
2017-11-20 21:07:10 +00:00
| [`AnimatedValueXY` ](docs/animatedvaluexy.html ) |
2017-11-08 00:34:50 +00:00
---
2017-11-09 17:47:50 +00:00
### Interpolation
2017-11-20 21:07:10 +00:00
Exported to use the Interpolation type in flow.
2017-11-08 00:34:50 +00:00
2017-11-09 17:47:50 +00:00
| Type |
| - |
| AnimatedInterpolation |
2017-11-08 00:34:50 +00:00
---
2017-11-09 17:47:50 +00:00
### Node
2017-11-20 21:07:10 +00:00
Exported for ease of type checking. All animated values derive from this class. See `AnimatedNode.js` .
2017-11-09 17:47:50 +00:00
| Type |
| - |
| AnimatedNode |
2017-11-08 00:34:50 +00:00