Finish comment in ReactDOMComponentTree

This commit is contained in:
Ben Alpert 2015-11-17 09:41:24 -08:00
parent d6a547f793
commit 6c89857cdc
2 changed files with 6 additions and 2 deletions

View File

@ -64,7 +64,10 @@ function uncacheNode(inst) {
* node every time.
*
* Since we update `_renderedChildren` and the actual DOM at (slightly)
* different times, we could race here and not get the
* different times, we could race here and see a newer `_renderedChildren` than
* the DOM nodes we see. To avoid this, ReactMultiChild calls
* `prepareToManageChildren` before we change `_renderedChildren`, at which
* time the container's child nodes are always cached (until it unmounts).
*/
function precacheChildNodes(inst, node) {
if (inst._flags & Flags.hasCachedChildNodes) {

View File

@ -1201,7 +1201,8 @@ assign(
prepareToManageChildren: function() {
// Before we add, remove, or reorder the children of a node, make sure
// we have references to all of its children so we don't lose them, even
// if nefarious browser plugins add extra nodes to our tree.
// if nefarious browser plugins add extra nodes to our tree. This could be
// called once per child so it should be fast.
ReactDOMComponentTree.precacheChildNodes(this, getNode(this));
},
}