mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Update implementation-notes.md
prevChild could be CompositeComponent which cause prevChild.node to be undefined.
This commit is contained in:
@@ -750,7 +750,7 @@ We collect DOM operations on children in a list so we can execute them in batch:
|
||||
// If we can't update an existing instance, we have to unmount it
|
||||
// and mount a new one instead of it.
|
||||
if (!canUpdate) {
|
||||
var prevNode = prevChild.node;
|
||||
var prevNode = prevChild.getHostNode();
|
||||
prevChild.unmount();
|
||||
|
||||
var nextChild = instantiateComponent(nextChildren[i]);
|
||||
@@ -771,7 +771,7 @@ We collect DOM operations on children in a list so we can execute them in batch:
|
||||
// Finally, unmount any children that don't exist:
|
||||
for (var j = nextChildren.length; j < prevChildren.length; j++) {
|
||||
var prevChild = prevRenderedChildren[j];
|
||||
var node = prevChild.node;
|
||||
var node = prevChild.getHostNode();
|
||||
prevChild.unmount();
|
||||
|
||||
// Record that we need to remove the node
|
||||
|
||||
Reference in New Issue
Block a user