Skip to content
Merged
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
13 changes: 8 additions & 5 deletions packages/react-devtools-shared/src/backend/fiber/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ export function attach(
currentRoot = rootInstance;
unmountInstanceRecursively(rootInstance);
rootToFiberInstanceMap.delete(root);
flushPendingEvents(root);
flushPendingEvents();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by fix. flushPendingEvents doesn't actually use any of its arguments.

currentRoot = (null: any);
});

Expand All @@ -1541,7 +1541,7 @@ export function attach(
currentRoot = newRoot;
setRootPseudoKey(currentRoot.id, root.current);
mountFiberRecursively(root.current, false);
flushPendingEvents(root);
flushPendingEvents();
currentRoot = (null: any);
});

Expand Down Expand Up @@ -2099,7 +2099,7 @@ export function attach(
}
}

function flushPendingEvents(root: Object): void {
function flushPendingEvents(): void {
if (shouldBailoutWithPendingOperations()) {
// If we aren't profiling, we can just bail out here.
// No use sending an empty update over the bridge.
Expand Down Expand Up @@ -5349,7 +5349,7 @@ export function attach(

mountFiberRecursively(root.current, false);

flushPendingEvents(root);
flushPendingEvents();

needsToFlushComponentLogs = false;
currentRoot = (null: any);
Expand Down Expand Up @@ -5452,6 +5452,9 @@ export function attach(
unmountInstanceRecursively(rootInstance);
removeRootPseudoKey(currentRoot.id);
rootToFiberInstanceMap.delete(root);
} else if (!prevWasMounted && !nextIsMounted) {
// We don't need this root anymore.
rootToFiberInstanceMap.delete(root);
}

if (isProfiling && isProfilingSupported) {
Expand All @@ -5475,7 +5478,7 @@ export function attach(
}

// We're done here.
flushPendingEvents(root);
flushPendingEvents();

needsToFlushComponentLogs = false;

Expand Down
Loading