Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/layoutanimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Automatically animates views to their new positions when the next layout happens

A common way to use this API is to call it before updating the state hook in functional components and calling `setState` in class components.

Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`:
:::note
On **Android**, when using the **Legacy Architecture**, you need to enable layout animations via `UIManager`. This flag enables layout animations globally and only needs to be called once (for example, in your app's root entry file `index.js` or root component) before triggering any layout animation:

```js
if (Platform.OS === 'android') {
Expand All @@ -17,6 +18,9 @@ if (Platform.OS === 'android') {
}
```

On the **New Architecture**, layout animations are enabled automatically, and calling `setLayoutAnimationEnabledExperimental` is unnecessary (it is a no-op).
:::

## Example

```SnackPlayer name=LayoutAnimation%20Example&supportedPlatforms=android,ios
Expand Down
Loading