mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Call updateMountedFlag in ShadowTree::tryCommit only if commit will go to native
Summary: Changelog: [internal] `updateMountedFlag` needs to be called only when new revision will be mounted. In case a commit is throttled, this wasn't the case. Therefore, moving cancellation of commit so it happens before `updateMountedFlag`. We already cancel commits on that place so it should be safe. Reviewed By: shergin Differential Revision: D26049262 fbshipit-source-id: e0ecdd2d8f0cdb09d0c0a07ad3931ce77bcf03cf
This commit is contained in:
committed by
Facebook GitHub Bot
parent
99b7052248
commit
78df536c78
@@ -371,7 +371,8 @@ CommitStatus ShadowTree::tryCommit(
|
||||
newRootShadowNode = delegate_.shadowTreeWillCommit(
|
||||
*this, oldRootShadowNode, newRootShadowNode);
|
||||
|
||||
if (!newRootShadowNode) {
|
||||
if (!newRootShadowNode ||
|
||||
(commitOptions.shouldCancel && commitOptions.shouldCancel())) {
|
||||
return CommitStatus::Cancelled;
|
||||
}
|
||||
|
||||
@@ -392,10 +393,6 @@ CommitStatus ShadowTree::tryCommit(
|
||||
currentRevision_ = newRevision;
|
||||
}
|
||||
|
||||
if (commitOptions.shouldCancel && commitOptions.shouldCancel()) {
|
||||
return CommitStatus::Cancelled;
|
||||
}
|
||||
|
||||
emitLayoutEvents(affectedLayoutableNodes);
|
||||
|
||||
if (commitMode == CommitMode::Normal) {
|
||||
|
||||
Reference in New Issue
Block a user