Browse Source

Merge pull request #41 from hardfist/patch-1

Update implementation-notes.md
main
Brian Vaughn 8 years ago
committed by GitHub
parent
commit
9b02db39d1
  1. 12
      content/docs/implementation-notes.md

12
content/docs/implementation-notes.md

@ -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 // If we can't update an existing instance, we have to unmount it
// and mount a new one instead of it. // and mount a new one instead of it.
if (!canUpdate) { if (!canUpdate) {
var prevNode = prevChild.node; var prevNode = prevChild.getHostNode();
prevChild.unmount(); prevChild.unmount();
var nextChild = instantiateComponent(nextChildren[i]); var nextChild = instantiateComponent(nextChildren[i]);
@ -770,12 +770,12 @@ We collect DOM operations on children in a list so we can execute them in batch:
// Finally, unmount any children that don't exist: // Finally, unmount any children that don't exist:
for (var j = nextChildren.length; j < prevChildren.length; j++) { for (var j = nextChildren.length; j < prevChildren.length; j++) {
var prevChild = prevRenderedChildren[j]; var prevChild = prevRenderedChildren[j];
var node = prevChild.node;     var node = prevChild.getHostNode();
prevChild.unmount(); prevChild.unmount();
// Record that we need to remove the node // Record that we need to remove the node
operationQueue.push({type: 'REMOVE', node}); operationQueue.push({type: 'REMOVE', node});
} }
// Point the list of rendered children to the updated version. // Point the list of rendered children to the updated version.

Loading…
Cancel
Save