-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Fix Animated.Value value after animation if component was re-mounted #24571
Conversation
cc @janicduplessis could you review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalchudziak It looks interesting. I was also trying to implement but didn't manage to find enough time. I'll happily see it merged.
However. Could you elaborate more on these changes? Looks quite tricky, why something like this should rely on invoking __getNativeTag
method.
@osdnk I found out that after re-mounting the element, it's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for figuring this out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ship it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @michalchudziak in b3f7d53. When will my fix make it into a release? | Upcoming Releases |
Summary
Fixes #23712
Currently, It seems like
__nativeAnimatedValueListener
is not listening to the correctonAnimatedValueUpdate
events if component was re-mounted. In this PR I'm attaching a new listener if the native view tag has changed.Changelog
[General] [Fixed] - Fixed Animated.Value value after animation if component was re-mounted
Test Plan
Compare fresh react native app with this branch and current master. Following code from @karhatsu demonstrates issue very well:
App.js