MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / commitAllHostEffects

Function commitAllHostEffects

code/dependency-injection/public/app.js:12907–12974  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12905 }
12906
12907 function commitAllHostEffects() {
12908 while (nextEffect !== null) {
12909 {
12910 ReactDebugCurrentFiber.setCurrentFiber(nextEffect);
12911 }
12912 recordEffect();
12913
12914 var effectTag = nextEffect.effectTag;
12915 if (effectTag & ContentReset) {
12916 commitResetTextContent(nextEffect);
12917 }
12918
12919 if (effectTag & Ref) {
12920 var current = nextEffect.alternate;
12921 if (current !== null) {
12922 commitDetachRef(current);
12923 }
12924 }
12925
12926 // The following switch statement is only concerned about placement,
12927 // updates, and deletions. To avoid needing to add a case for every
12928 // possible bitmap value, we remove the secondary effects from the
12929 // effect tag and switch on that value.
12930 var primaryEffectTag = effectTag & (Placement | Update | Deletion);
12931 switch (primaryEffectTag) {
12932 case Placement:
12933 {
12934 commitPlacement(nextEffect);
12935 // Clear the "placement" from effect tag so that we know that this is inserted, before
12936 // any life-cycles like componentDidMount gets called.
12937 // TODO: findDOMNode doesn't rely on this any more but isMounted
12938 // does and isMounted is deprecated anyway so we should be able
12939 // to kill this.
12940 nextEffect.effectTag &= ~Placement;
12941 break;
12942 }
12943 case PlacementAndUpdate:
12944 {
12945 // Placement
12946 commitPlacement(nextEffect);
12947 // Clear the "placement" from effect tag so that we know that this is inserted, before
12948 // any life-cycles like componentDidMount gets called.
12949 nextEffect.effectTag &= ~Placement;
12950
12951 // Update
12952 var _current = nextEffect.alternate;
12953 commitWork(_current, nextEffect);
12954 break;
12955 }
12956 case Update:
12957 {
12958 var _current2 = nextEffect.alternate;
12959 commitWork(_current2, nextEffect);
12960 break;
12961 }
12962 case Deletion:
12963 {
12964 commitDeletion(nextEffect);

Callers

nothing calls this directly

Calls 6

recordEffectFunction · 0.70
commitResetTextContentFunction · 0.70
commitDetachRefFunction · 0.70
commitPlacementFunction · 0.70
commitWorkFunction · 0.70
commitDeletionFunction · 0.70

Tested by

no test coverage detected