-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Commit hook #54138
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
Closed
Closed
Commit hook #54138
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
|
@bartlomiejbloniarz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D84250600. |
Job Summary for GradleTest All :: run_fantom_tests
|
Job Summary for GradleTest All :: build_android
|
facebook-github-bot
pushed a commit
that referenced
this pull request
Nov 24, 2025
Summary: This diff introduces `AnimationBackendCommitHook`. It is responsible for keeping animation updates in sync with React. When React does its updates, it doesn't look at the last mounted tree. Instead it hold its own references to ShadowNodes, and commits them whenever there is a (JS) rendering update. Any props that were commited are lost. To work around this we have the Commit Hook. It enables us to override any rendering updates that react does, just before the ShadowTree enters the layout phase. In this implementation we utilize RNSRU to push those updates back to React (whenever there is a commit originating from React). So after a render React will now hold references to ShadowNodes with the current animation state (in props). This is a new approach, in Reanimated's current implementation this is disabled, and we reapply the changes via the Commit Hook on each React commit. Differential Revision: D84250600
8f1d19f to
6acf31e
Compare
facebook-github-bot
pushed a commit
that referenced
this pull request
Nov 24, 2025
Summary: This diff introduces `AnimationBackendCommitHook`. It is responsible for keeping animation updates in sync with React. When React does its updates, it doesn't look at the last mounted tree. Instead it hold its own references to ShadowNodes, and commits them whenever there is a (JS) rendering update. Any props that were commited from outside of React (e.g. by Reanimated) are lost. To work around this we have the Commit Hook. It enables us to override any rendering updates that react does, just before the ShadowTree enters the layout phase. In this implementation we utilize RNSRU to push those updates back to React (whenever there is a commit originating from React). So after a render React will now hold references to ShadowNodes with the current animation state (in props). This is a new approach, in Reanimated's current implementation this is disabled, and we reapply the changes via the Commit Hook on each React commit. Differential Revision: D84250600
facebook-github-bot
pushed a commit
that referenced
this pull request
Nov 24, 2025
Summary: This diff introduces `AnimationBackendCommitHook`. It is responsible for keeping animation updates in sync with React. When React does its updates, it doesn't look at the last mounted tree. Instead it hold its own references to ShadowNodes, and commits them whenever there is a (JS) rendering update. Any props that were commited from outside of React (e.g. by Reanimated) are lost. To work around this we have the Commit Hook. It enables us to override any rendering updates that react does, just before the ShadowTree enters the layout phase. In this implementation we utilize RNSRU to push those updates back to React (whenever there is a commit originating from React). So after a render React will now hold references to ShadowNodes with the current animation state (in props). This is a new approach, in Reanimated's current implementation this is disabled, and we reapply the changes via the Commit Hook on each React commit. Differential Revision: D84250600
284f9c6 to
ec51fc0
Compare
facebook-github-bot
pushed a commit
that referenced
this pull request
Nov 25, 2025
Summary: This diff introduces `AnimationBackendCommitHook`. It is responsible for keeping animation updates in sync with React. When React does its updates, it doesn't look at the last mounted tree. Instead it hold its own references to ShadowNodes, and commits them whenever there is a (JS) rendering update. Any props that were commited from outside of React (e.g. by Reanimated) are lost. To work around this we have the Commit Hook. It enables us to override any rendering updates that react does, just before the ShadowTree enters the layout phase. In this implementation we utilize RNSRU to push those updates back to React (whenever there is a commit originating from React). So after a render React will now hold references to ShadowNodes with the current animation state (in props). This is a new approach, in Reanimated's current implementation this is disabled, and we reapply the changes via the Commit Hook on each React commit. Differential Revision: D84250600
facebook-github-bot
pushed a commit
that referenced
this pull request
Dec 1, 2025
Summary: This diff introduces `AnimationBackendCommitHook`. It is responsible for keeping animation updates in sync with React. When React does its updates, it doesn't look at the last mounted tree. Instead it hold its own references to ShadowNodes, and commits them whenever there is a (JS) rendering update. Any props that were commited from outside of React (e.g. by Reanimated) are lost. To work around this we have the Commit Hook. It enables us to override any rendering updates that react does, just before the ShadowTree enters the layout phase. In this implementation we utilize RNSRU to push those updates back to React (whenever there is a commit originating from React). So after a render React will now hold references to ShadowNodes with the current animation state (in props). This is a new approach, in Reanimated's current implementation this is disabled, and we reapply the changes via the Commit Hook on each React commit. Differential Revision: D84250600
ec51fc0 to
c516cab
Compare
facebook-github-bot
pushed a commit
that referenced
this pull request
Dec 5, 2025
Summary: This diff introduces `AnimationBackendCommitHook`. It is responsible for keeping animation updates in sync with React. When React does its updates, it doesn't look at the last mounted tree. Instead it hold its own references to ShadowNodes, and commits them whenever there is a (JS) rendering update. Any props that were commited from outside of React (e.g. by Reanimated) are lost. To work around this we have the Commit Hook. It enables us to override any rendering updates that react does, just before the ShadowTree enters the layout phase. In this implementation we utilize RNSRU to push those updates back to React (whenever there is a commit originating from React). So after a render React will now hold references to ShadowNodes with the current animation state (in props). This is a new approach, in Reanimated's current implementation this is disabled, and we reapply the changes via the Commit Hook on each React commit. Reviewed By: sammy-SC, zeyap Differential Revision: D84250600
c516cab to
9faec36
Compare
Job Summary for GradleTest All :: run_fantom_tests
|
Summary: This PR allows C++ Native Animated to use `ShadowNodeFamily` instances to use the `cloneMultiple` method when pushing updates through the `ShadowTree` in `AnimationBackend` # Changelog [General] [Added] - Add `connectAnimatedNodeToShadowNodeFamily` method to `NativeAnimatedModule` and `NativeAnimatedTurboModule` Reviewed By: sammy-SC, zeyap Differential Revision: D84055752
Summary: This diff introduces `AnimationBackendCommitHook`. It is responsible for keeping animation updates in sync with React. When React does its updates, it doesn't look at the last mounted tree. Instead it hold its own references to ShadowNodes, and commits them whenever there is a (JS) rendering update. Any props that were commited from outside of React (e.g. by Reanimated) are lost. To work around this we have the Commit Hook. It enables us to override any rendering updates that react does, just before the ShadowTree enters the layout phase. In this implementation we utilize RNSRU to push those updates back to React (whenever there is a commit originating from React). So after a render React will now hold references to ShadowNodes with the current animation state (in props). This is a new approach, in Reanimated's current implementation this is disabled, and we reapply the changes via the Commit Hook on each React commit. Reviewed By: sammy-SC, zeyap Differential Revision: D84250600
9faec36 to
32ed76d
Compare
|
This pull request has been merged in d04e152. |
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.
meta-exported
p: Facebook
Partner: Facebook
p: Software Mansion
Partner: Software Mansion
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.
Differential Revision: D84250600
This diff introduces AnimationBackendCommitHook. It is responsible for keeping animation updates in sync with React. When React does its updates, it doesn't look at the last mounted tree. Instead it hold its own references to ShadowNodes, and commits them whenever there is a (JS) rendering update. Any props that were commited from outside of React (e.g. by Reanimated) are lost.
To work around this we have the Commit Hook. It enables us to override any rendering updates that react does, just before the ShadowTree enters the layout phase.
In this implementation we utilize RNSRU to push those updates back to React (whenever there is a commit originating from React). So after a render React will now hold references to ShadowNodes with the current animation state (in props). This is a new approach, in Reanimated's current implementation this is disabled, and we reapply the changes via the Commit Hook on each React commit.