Skip to content

Commit

Permalink
Transfer mounted effects on suspend in legacy mode
Browse files Browse the repository at this point in the history
In legacy mode, a component that suspends bails out and commit in
its previous state. If the component previously had mounted effects,
we must transfer those to the work-in-progress so they don't
get dropped.
  • Loading branch information
acdlite committed Mar 6, 2020
1 parent 855aab3 commit 3d0cfef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-reconciler/src/ReactFiberThrow.js
Expand Up @@ -199,9 +199,11 @@ function throwException(
// to render it.
let currentSource = sourceFiber.alternate;
if (currentSource) {
sourceFiber.updateQueue = currentSource.updateQueue;
sourceFiber.memoizedState = currentSource.memoizedState;
sourceFiber.expirationTime = currentSource.expirationTime;
} else {
sourceFiber.updateQueue = null;
sourceFiber.memoizedState = null;
}
}
Expand Down

0 comments on commit 3d0cfef

Please sign in to comment.