Finish comment in ReactDOMComponentTree
This commit is contained in:
parent
d6a547f793
commit
6c89857cdc
|
@ -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) {
|
||||
|
|
|
@ -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));
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue