-
Notifications
You must be signed in to change notification settings - Fork 136
clearing a LayoutAnimation #460
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
Comments
Hi @stopachka, I'm struggling to imagine the case where this would happen. Can you elaborate more on your example? |
Hey @p-syche, sure thing! Admittedly a bit unique, but here's one:
Here, we trigger a LayoutAnimation, when we're about to change It's possible to avoid this, by triggering a LayoutAnimation based on |
I can second on this when using with modal, if you forget that there's a pending LayoutAnimation and try to close the modal down (with |
Uh oh!
There was an error while loading. Please reload this page.
Introduction
LayoutAnimation
is excellent for creating delightful animations.Details
One issue programmers need to deal with, is that it can be hard to detect when
layout
happens. Consider:Here, it's likely that
setState(newState)
triggers a layout. However, if the vdom diffs and finds no change, then no layout will call. This can then introduce a slight bug. If a few minutes later a user makes another interaction, they'll experience an unexpected animation.Discussion points
So comes the question: what's the best way to say, I expect a LayoutAnimation to happen shortly, cancel if it doesn't?
An imperative api could like this:
Where a user can manually choose to clear the animation if it hasn't happened by some time.
Am really curious what ya'll think / if you have different ideas.
The text was updated successfully, but these errors were encountered: