-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Layout Animations for the New Architecture #6055
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
Merged
bartlomiejbloniarz
merged 85 commits into
main
from
@bartlomiejbloniarz/fabric-layout-animations
Jun 18, 2024
Merged
Layout Animations for the New Architecture #6055
bartlomiejbloniarz
merged 85 commits into
main
from
@bartlomiejbloniarz/fabric-layout-animations
Jun 18, 2024
Conversation
This file contains hidden or 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
piaskowyk
approved these changes
Jun 17, 2024
Member
piaskowyk
left a comment
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.
Great work 👏👏👏
For me, this is ready to merge. Let users test it in real-life scenarios, and we can gather feedback accordingly.
Contributor
|
Nice work guys 👏 |
This was referenced Jul 25, 2024
r0h0gg6
pushed a commit
to r0h0gg6/react-native-reanimated
that referenced
this pull request
Jul 28, 2025
## Summary This PR brings layout animations to the New Architecture. In the Old Architecture layout animations were implemented separately for iOS and Android. The new implementation leverages the `MountingOverrideDelegate` to intercept and animate layout changes right before they are sent to the platform. This way we can have a unified implementation across platforms (it should also work beyond Android and iOS). ## `MountingOverrideDelegate` The override delegate is called every time a new transaction is about to be mounted. It gives us full access to the mutations list and allows us to change them. This mechanism is used by RN, also in Layout Animations. It is important to note that this way we never commit a new `ShadowTree` - we only change the mutations that are sent to the platform. This means that those changes don't influence the layout of other views, which is consistent with the Old Arch implementation. ## Limitations - configuration of entering animations is done using `nativeID` since I was unable to obtain the `tag` of a view before the animation should start - `skipExiting` does not work properly on android (I'm not sure why the `componentWillUnmount` method is called there earlier than on iOS) - `globalOriginX` and `globalOriginY` currently return the values of `originX` and `originY` - this part will probably require a native `convertPoint` function to be used - due to view flattening some exiting animations behave differently. The issue is explained in [this PR](facebook/react-native#44043). ## Test plan Go through the Layout Animations examples in the FabricExample app.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR brings layout animations to the New Architecture.
In the Old Architecture layout animations were implemented separately for iOS and Android. The new implementation leverages the
MountingOverrideDelegateto intercept and animate layout changes right before they are sent to the platform. This way we can have a unified implementation across platforms (it should also work beyond Android and iOS).MountingOverrideDelegateThe override delegate is called every time a new transaction is about to be mounted. It gives us full access to the mutations list and allows us to change them. This mechanism is used by RN, also in Layout Animations. It is important to note that this way we never commit a new
ShadowTree- we only change the mutations that are sent to the platform. This means that those changes don't influence the layout of other views, which is consistent with the Old Arch implementation.Limitations
nativeIDsince I was unable to obtain thetagof a view before the animation should startskipExitingdoes not work properly on android (I'm not sure why thecomponentWillUnmountmethod is called there earlier than on iOS)globalOriginXandglobalOriginYcurrently return the values oforiginXandoriginY- this part will probably require a nativeconvertPointfunction to be usedTest plan
Go through the Layout Animations examples in the FabricExample app.