Skip to content
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

Clarify use of UIManager for LayoutAnimation on Android #889

Open
dev6james opened this issue Apr 15, 2019 · 4 comments
Open

Clarify use of UIManager for LayoutAnimation on Android #889

dev6james opened this issue Apr 15, 2019 · 4 comments
Labels
👻 Missing Docs Documentation is missing 👋 Good first issue Interested in collaborating? Take a stab at fixing one of these issues.

Comments

@dev6james
Copy link

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.

@dev6james dev6james changed the title Clarify use of UIManager for LayoutAnimation on Androod Clarify use of UIManager for LayoutAnimation on Android Apr 15, 2019
@dev6james
Copy link
Author

Note: I don't know what the answer to that is, because it's not in the docs. Lol.

@Simek
Copy link
Collaborator

Simek commented 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 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.

@Simek Simek added the 👋 Good first issue Interested in collaborating? Take a stab at fixing one of these issues. label May 4, 2020
@dev6james
Copy link
Author

dev6james commented May 5, 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 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.

@lorenz068
Copy link

lorenz068 commented Jun 5, 2020

I test it and it works globally (setup in the top component (<App /> in my case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👻 Missing Docs Documentation is missing 👋 Good first issue Interested in collaborating? Take a stab at fixing one of these issues.
Projects
None yet
Development

No branches or pull requests

3 participants