MCPcopy Create free account
hub / github.com/reactjs/react-rails / commitMutationEffects

Function commitMutationEffects

lib/assets/react-source/development/react.js:26404–26487  ·  view source on GitHub ↗
(root, renderPriorityLevel)

Source from the content-addressed store, hash-verified

26402 }
26403
26404 function commitMutationEffects(root, renderPriorityLevel) {
26405 // TODO: Should probably move the bulk of this function to commitWork.
26406 while (nextEffect !== null) {
26407 setCurrentFiber(nextEffect);
26408 var effectTag = nextEffect.effectTag;
26409
26410 if (effectTag & ContentReset) {
26411 commitResetTextContent(nextEffect);
26412 }
26413
26414 if (effectTag & Ref) {
26415 var current = nextEffect.alternate;
26416
26417 if (current !== null) {
26418 commitDetachRef(current);
26419 }
26420 } // The following switch statement is only concerned about placement,
26421 // updates, and deletions. To avoid needing to add a case for every possible
26422 // bitmap value, we remove the secondary effects from the effect tag and
26423 // switch on that value.
26424
26425
26426 var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);
26427
26428 switch (primaryEffectTag) {
26429 case Placement:
26430 {
26431 commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
26432 // inserted, before any life-cycles like componentDidMount gets called.
26433 // TODO: findDOMNode doesn't rely on this any more but isMounted does
26434 // and isMounted is deprecated anyway so we should be able to kill this.
26435
26436 nextEffect.effectTag &= ~Placement;
26437 break;
26438 }
26439
26440 case PlacementAndUpdate:
26441 {
26442 // Placement
26443 commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
26444 // inserted, before any life-cycles like componentDidMount gets called.
26445
26446 nextEffect.effectTag &= ~Placement; // Update
26447
26448 var _current = nextEffect.alternate;
26449 commitWork(_current, nextEffect);
26450 break;
26451 }
26452
26453 case Hydrating:
26454 {
26455 nextEffect.effectTag &= ~Hydrating;
26456 break;
26457 }
26458
26459 case HydratingAndUpdate:
26460 {
26461 nextEffect.effectTag &= ~Hydrating; // Update

Callers

nothing calls this directly

Calls 8

setCurrentFiberFunction · 0.85
commitResetTextContentFunction · 0.85
commitDetachRefFunction · 0.85
commitPlacementFunction · 0.85
commitWorkFunction · 0.85
commitDeletionFunction · 0.85
recordEffectFunction · 0.85
resetCurrentFiberFunction · 0.85

Tested by

no test coverage detected