react-native-website
react-native-website copied to clipboard
Clarify use of UIManager for LayoutAnimation on Android
https://facebook.github.io/react-native/docs/layoutanimation.html
This page says the following:
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.
Note: I don't know what the answer to that is, because it's not in the docs. Lol.
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.
I test it and it works globally (setup in the top component (<App />
in my case)