File tree Expand file tree Collapse file tree
packages/react-reconciler/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -681,11 +681,13 @@ function completeWork(
681681 // If we hydrated, then we'll need to schedule an update for
682682 // the commit side-effects on the root.
683683 markUpdate ( workInProgress ) ;
684- } else {
684+ } else if ( ! fiberRoot . hydrate ) {
685685 // Schedule an effect to clear this container at the start of the next commit.
686686 // This handles the case of React rendering into a container with previous children.
687687 // It's also safe to do for updates too, because current.child would only be null
688688 // if the previous render was null (so the the container would already be empty).
689+ //
690+ // The additional root.hydrate check is required for hydration in legacy mode with no fallback.
689691 workInProgress . effectTag |= Snapshot ;
690692 }
691693 }
Original file line number Diff line number Diff line change @@ -679,11 +679,13 @@ function completeWork(
679679 // If we hydrated, then we'll need to schedule an update for
680680 // the commit side-effects on the root.
681681 markUpdate ( workInProgress ) ;
682- } else {
682+ } else if ( ! fiberRoot . hydrate ) {
683683 // Schedule an effect to clear this container at the start of the next commit.
684684 // This handles the case of React rendering into a container with previous children.
685685 // It's also safe to do for updates too, because current.child would only be null
686686 // if the previous render was null (so the the container would already be empty).
687+ //
688+ // The additional root.hydrate check is required for hydration in legacy mode with no fallback.
687689 workInProgress . effectTag |= Snapshot ;
688690 }
689691 }
You can’t perform that action at this time.
0 commit comments