Skip to content

docs: update LayoutAnimation guide for RN 0.79+ (fixes #4600) #4682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion docs/layoutanimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ A common way to use this API is to call it before updating the state hook in fun

Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`:

> ⚠️ **Note (React Native 0.79+)**:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share the react-native PR where this was changed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cortinico
Thank you for reviewing my PR!

The change was officially introduced in the React Native 0.79 release, where UIManager.setLayoutAnimationEnabledExperimental(true) is no longer required, it’s enabled by default for Android.
Unfortunately, the original PR that introduced this change appears to have been deleted or made private, and the release blog no longer includes specific mention of it. However, the change has been verified through community discussions and by observing recent versions of the RNTester app, where the call has been removed

> `UIManager.setLayoutAnimationEnabledExperimental(true)` is **no longer needed** in React Native 0.79+ and above. It is enabled by default now.

If you're using an older version (before 0.79), you can still use:

```js
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
}
```


## Example

Expand Down