Skip to content

Commit

Permalink
chore(fast-refresh): double check wasMounted (#22740)
Browse files Browse the repository at this point in the history
  • Loading branch information
anc95 authored Nov 18, 2021
1 parent b32b677 commit b831aec
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 b831aec

Please sign in to comment.