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

Function commitAllHostEffects

code/composition/public/app.js:12952–13019  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12950 }
12951
12952 function commitAllHostEffects() {
12953 while (nextEffect !== null) {
12954 {
12955 ReactDebugCurrentFiber.setCurrentFiber(nextEffect);
12956 }
12957 recordEffect();
12958
12959 var effectTag = nextEffect.effectTag;
12960 if (effectTag & ContentReset) {
12961 commitResetTextContent(nextEffect);
12962 }
12963
12964 if (effectTag & Ref) {
12965 var current = nextEffect.alternate;
12966 if (current !== null) {
12967 commitDetachRef(current);
12968 }
12969 }
12970
12971 // The following switch statement is only concerned about placement,
12972 // updates, and deletions. To avoid needing to add a case for every
12973 // possible bitmap value, we remove the secondary effects from the
12974 // effect tag and switch on that value.
12975 var primaryEffectTag = effectTag & (Placement | Update | Deletion);
12976 switch (primaryEffectTag) {
12977 case Placement:
12978 {
12979 commitPlacement(nextEffect);
12980 // Clear the "placement" from effect tag so that we know that this is inserted, before
12981 // any life-cycles like componentDidMount gets called.
12982 // TODO: findDOMNode doesn't rely on this any more but isMounted
12983 // does and isMounted is deprecated anyway so we should be able
12984 // to kill this.
12985 nextEffect.effectTag &= ~Placement;
12986 break;
12987 }
12988 case PlacementAndUpdate:
12989 {
12990 // Placement
12991 commitPlacement(nextEffect);
12992 // Clear the "placement" from effect tag so that we know that this is inserted, before
12993 // any life-cycles like componentDidMount gets called.
12994 nextEffect.effectTag &= ~Placement;
12995
12996 // Update
12997 var _current = nextEffect.alternate;
12998 commitWork(_current, nextEffect);
12999 break;
13000 }
13001 case Update:
13002 {
13003 var _current2 = nextEffect.alternate;
13004 commitWork(_current2, nextEffect);
13005 break;
13006 }
13007 case Deletion:
13008 {
13009 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