Skip to content

Commit 7ee893d

Browse files
j-piaseckimeta-codesync[bot]
authored andcommitted
Don't update mounted flag on React revision (#56371)
Summary: Pull Request resolved: #56371 Changelog: [GENERAL][FIXED] - Prevent updates to mounted flag on the React revision Currently, with fabric branching enabled, the logic for `updateMountedFlag` can run twice for the same tree: first when committing it to a react revision, then when merging to the main revision. This has the potential to drive `enableCounter_ ` negative. This diff, makes it so that `updateMountedFlag` runs only when committing to the main branch. Reviewed By: rubennorte, cipolleschi Differential Revision: D99996551 fbshipit-source-id: 8e578b3bf1e22ef1f87fdd0df20dc25bb4631ccf
1 parent 4a59f90 commit 7ee893d

File tree

1 file changed

+1
-1
lines changed
  • packages/react-native/ReactCommon/react/renderer/mounting

1 file changed

+1
-1
lines changed

packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ CommitStatus ShadowTree::tryCommit(
422422

423423
auto newRevisionNumber = currentRevision_.number + 1;
424424

425-
{
425+
if (!isReactBranch) {
426426
std::scoped_lock dispatchLock(EventEmitter::DispatchMutex());
427427
updateMountedFlag(
428428
currentRevision_.rootShadowNode->getChildren(),

0 commit comments

Comments
 (0)