Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ void ReanimatedCommitHook::maybeInitializeLayoutAnimations(
RootShadowNode::Unshared ReanimatedCommitHook::shadowTreeWillCommit(
ShadowTree const &,
RootShadowNode::Shared const &,
RootShadowNode::Unshared const &newRootShadowNode) noexcept {
RootShadowNode::Unshared const &newRootShadowNode
#if REACT_NATIVE_MINOR_VERSION >= 80
,
const ShadowTreeCommitOptions &commitOptions
#endif
) noexcept {
ReanimatedSystraceSection s("ReanimatedCommitHook::shadowTreeWillCommit");

maybeInitializeLayoutAnimations(newRootShadowNode->getSurfaceId());
Expand Down Expand Up @@ -86,8 +91,15 @@ RootShadowNode::Unshared ReanimatedCommitHook::shadowTreeWillCommit(
// props will be applied in ReanimatedCommitHook by UpdatesRegistryManager
// This is very important, since if we didn't pause Reanimated commits,
// it could lead to RN commits being delayed until the animation is finished
// (very bad).
// (very bad). We don't pause Reanimated commits for state updates coming
// from React Native as this would break sticky header animations.
#if REACT_NATIVE_MINOR_VERSION >= 80
if (commitOptions.source == ShadowTreeCommitSource::React) {
updatesRegistryManager_->pauseReanimatedCommits();
}
#else
updatesRegistryManager_->pauseReanimatedCommits();
#endif
}

return rootNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ class ReanimatedCommitHook
RootShadowNode::Unshared shadowTreeWillCommit(
ShadowTree const &shadowTree,
RootShadowNode::Shared const &oldRootShadowNode,
RootShadowNode::Unshared const &newRootShadowNode) noexcept override;
RootShadowNode::Unshared const &newRootShadowNode
#if REACT_NATIVE_MINOR_VERSION >= 80
,
const ShadowTreeCommitOptions &commitOptions
#endif
) noexcept override;

private:
std::shared_ptr<UIManager> uiManager_;
Expand Down
Loading