You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clarify use of UIManager for LayoutAnimation on Android #889
Note that in order to get this to work on Android you need to set the following flags via UIManager:
UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);
What is unclear is if this needs to be done once globally, or on a per component basis. This should be made clearer.
changed the title [-]Clarify use of UIManager for LayoutAnimation on Androod[/-][+]Clarify use of UIManager for LayoutAnimation on Android[/+]on Apr 15, 2019
Hi @dev6james, it looks like PR #1191 improved the example but information you are looking for is still missing.
From the React Native source code and internal examples I can tell you that setLayoutAnimationEnabledExperimental can be used globally (in the index file) or locally, inside the component. It would be nice if someone can confirm that and update the docs.
Hi @dev6james, it looks like PR #1191 improved the example but information you are looking for is still missing.
From the React Native source code and internal examples I can tell you that setLayoutAnimationEnabledExperimental can be used globally (in the index file) or locally, inside the component. It would be nice if someone can confirm that and update the docs.
It would indeed :)
Maybe I wasn't clear enough in the original post. I was trying to get a sense of: if one component calls setLayoutAnimationEnabledExperimental, does that mean it's globally activated for all components? Or is it only applied to the current component?
I don't know the native implementation (nor should I need to) so it's not clear whether you can "pick and choose" which components to use it for.
Hi — happy to pick this up if it's still open for grabs.
The note on the LayoutAnimation page still doesn't say whether setLayoutAnimationEnabledExperimental needs to be called once or per component. The page's own example sets the flag a single time at module scope, so the intent is "call it once before any layout animation runs," not per component — I'd make that explicit.
While checking, I noticed the note is also partly outdated: on the New Architecture this method is a no-op (in dev it logs setLayoutAnimationEnabledExperimental is currently a no-op in the New Architecture.), so the flag isn't needed there at all.
Proposed edit to docs/layoutanimation.md:
Clarify the flag only needs to be set once, near your app's entry point, before triggering a layout animation.
Add a short note that it's a no-op on the New Architecture, so it only applies to the old architecture.
I'll keep it concise and follow the style guide. Does that scope sound right?
Activity
[-]Clarify use of UIManager for LayoutAnimation on Androod[/-][+]Clarify use of UIManager for LayoutAnimation on Android[/+]dev6james commentedon Apr 15, 2019
Note: I don't know what the answer to that is, because it's not in the docs. Lol.
Simek commentedon May 4, 2020
Hi @dev6james, it looks like PR #1191 improved the example but information you are looking for is still missing.
From the React Native source code and internal examples I can tell you that
setLayoutAnimationEnabledExperimentalcan be used globally (in the index file) or locally, inside the component. It would be nice if someone can confirm that and update the docs.dev6james commentedon May 5, 2020
It would indeed :)
Maybe I wasn't clear enough in the original post. I was trying to get a sense of: if one component calls
setLayoutAnimationEnabledExperimental, does that mean it's globally activated for all components? Or is it only applied to the current component?I don't know the native implementation (nor should I need to) so it's not clear whether you can "pick and choose" which components to use it for.
lorenz068 commentedon Jun 5, 2020
I test it and it works globally (setup in the top component (
<App />in my case)theprantadutta commentedon Jun 15, 2026
Hi — happy to pick this up if it's still open for grabs.
The note on the LayoutAnimation page still doesn't say whether
setLayoutAnimationEnabledExperimentalneeds to be called once or per component. The page's own example sets the flag a single time at module scope, so the intent is "call it once before any layout animation runs," not per component — I'd make that explicit.While checking, I noticed the note is also partly outdated: on the New Architecture this method is a no-op (in dev it logs
setLayoutAnimationEnabledExperimental is currently a no-op in the New Architecture.), so the flag isn't needed there at all.Proposed edit to
docs/layoutanimation.md:I'll keep it concise and follow the style guide. Does that scope sound right?