-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Animated: Fix onUserDrivenAnimationEnded
w/ Insertion Effects
#48678
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Jan 14, 2025
This pull request was exported from Phabricator. Differential Revision: D68171721 |
…book#48678) Summary: While diagnosing a recent issue in which `AnimatedValue` instances were not being correctly updated as expected, the insertion effects feature flag was identified as a root cause. Upon further investigation, it appears that this is because the `onUserDrivenAnimationEnded` listener was not implemented the same way in the two feature flag states: - When `useInsertionEffectsForAnimations` is disabled, `useAnimatedProps` listens to `onUserDrivenAnimationEnded` in a passive effect, after all nodes have been attached. - When `useInsertionEffectsForAnimations` is enabled, `useAnimatedProps` listens to `onUserDrivenAnimationEnded` in an insertion effect when attaching nodes. The bugs occurs because `useAnimatedProps` checks whether native driver is employed to decide whether to listen to `onUserDrivenAnimationEnded`. However, we do not know whether native driver will be employed during the insertion effect. (Actually, we do not necessarily know that in a passive effect, either... but that is a separate matter.) This fixes the bug when that occurs when `useInsertionEffectsForAnimations` is enabled, by moving the listening logic of `onUserDrivenAnimationEnded` into a passive effect. This is the same way that it is implemented when `useInsertionEffectsForAnimations` is disabled. Changelog: [Internal] Differential Revision: D68171721
yungsters
force-pushed
the
export-D68171721
branch
from
January 14, 2025 23:42
00af87c
to
62ed97f
Compare
This pull request was exported from Phabricator. Differential Revision: D68171721 |
This pull request has been merged in 00d272f. |
This pull request was successfully merged by @yungsters in 00d272f When will my fix make it into a release? | How to file a pick request? |
yungsters
added a commit
to yungsters/react-native
that referenced
this pull request
Jan 15, 2025
Summary: {D68171721} [facebook#48678](facebook#48678) mitigated the bug that necessitated this revert. Changelog: [General][Changed] - (Reapply) The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects. Differential Revision: D68217144
facebook-github-bot
pushed a commit
that referenced
this pull request
Jan 15, 2025
Summary: Pull Request resolved: #48708 {D68171721} [#48678](#48678) mitigated the bug that necessitated this revert. Changelog: [General][Changed] - (Reapply) The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects. Reviewed By: sammy-SC Differential Revision: D68217144 fbshipit-source-id: 6796440f2839d897158528642e07869951651327
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
This PR has been merged.
p: Facebook
Partner: Facebook
Partner
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
While diagnosing a recent issue in which
AnimatedValue
instances were not being correctly updated as expected, the insertion effects feature flag was identified as a root cause.Upon further investigation, it appears that this is because the
onUserDrivenAnimationEnded
listener was not implemented the same way in the two feature flag states:useInsertionEffectsForAnimations
is disabled,useAnimatedProps
listens toonUserDrivenAnimationEnded
in a passive effect, after all nodes have been attached.useInsertionEffectsForAnimations
is enabled,useAnimatedProps
listens toonUserDrivenAnimationEnded
in an insertion effect when attaching nodes.The bugs occurs because
useAnimatedProps
checks whether native driver is employed to decide whether to listen toonUserDrivenAnimationEnded
. However, we do not know whether native driver will be employed during the insertion effect. (Actually, we do not necessarily know that in a passive effect, either... but that is a separate matter.)This fixes the bug when that occurs when
useInsertionEffectsForAnimations
is enabled, by moving the listening logic ofonUserDrivenAnimationEnded
into a passive effect. This is the same way that it is implemented whenuseInsertionEffectsForAnimations
is disabled.Changelog:
[Internal]
Differential Revision: D68171721