Skip to content

Commit 56146f8

Browse files
committed
chore(fast-refresh): double check wasMounted
1 parent e0aa5e2 commit 56146f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-refresh/src/ReactFreshRuntime.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,9 @@ export function injectIntoGlobalHook(globalObject: any): void {
554554
if (alternate !== null) {
555555
const wasMounted =
556556
alternate.memoizedState != null &&
557-
alternate.memoizedState.element != null;
557+
alternate.memoizedState.element != null &&
558+
mountedRoots.has(root);
559+
558560
const isMounted =
559561
current.memoizedState != null &&
560562
current.memoizedState.element != null;

0 commit comments

Comments
 (0)