Skip to content

Commit

Permalink
HostText needs to copy over from current if it is unchanged in persis…
Browse files Browse the repository at this point in the history
…tent mode (#17538)

stateNode is not one of the fields that gets copied over by createWorkInProgress.

This is bad for persistent mode since it's not the same instance.

In HostComponent we happened to always end up transferring the current stateNode when we bail.
However, we didn't do this for HostText.
  • Loading branch information
sebmarkbage authored and gaearon committed Jan 3, 2020
1 parent 7e2ab87 commit 59f21f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-reconciler/src/ReactFiberCompleteWork.js
Expand Up @@ -539,6 +539,8 @@ if (supportsMutation) {
// We'll have to mark it as having an effect, even though we won't use the effect for anything.
// This lets the parents know that at least one of their children has changed.
markUpdate(workInProgress);
} else {
workInProgress.stateNode = current.stateNode;
}
};
} else {
Expand Down

0 comments on commit 59f21f1

Please sign in to comment.