Skip to content

Commit

Permalink
chore(fast-refresh): double check wasMounted
Browse files Browse the repository at this point in the history
  • Loading branch information
anc95 committed Nov 11, 2021
1 parent e0aa5e2 commit 56146f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-refresh/src/ReactFreshRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,9 @@ export function injectIntoGlobalHook(globalObject: any): void {
if (alternate !== null) {
const wasMounted =
alternate.memoizedState != null &&
alternate.memoizedState.element != null;
alternate.memoizedState.element != null &&
mountedRoots.has(root);

const isMounted =
current.memoizedState != null &&
current.memoizedState.element != null;
Expand Down

0 comments on commit 56146f8

Please sign in to comment.