MCPcopy Create free account
hub / github.com/plotly/dash / commitHookEffectListMount

Function commitHookEffectListMount

dash/deps/react-dom@18.3.1.js:23172–23247  ·  view source on GitHub ↗
(flags, finishedWork)

Source from the content-addressed store, hash-verified

23170 }
23171
23172 function commitHookEffectListMount(flags, finishedWork) {
23173 var updateQueue = finishedWork.updateQueue;
23174 var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
23175
23176 if (lastEffect !== null) {
23177 var firstEffect = lastEffect.next;
23178 var effect = firstEffect;
23179
23180 do {
23181 if ((effect.tag & flags) === flags) {
23182 {
23183 if ((flags & Passive$1) !== NoFlags$1) {
23184 markComponentPassiveEffectMountStarted(finishedWork);
23185 } else if ((flags & Layout) !== NoFlags$1) {
23186 markComponentLayoutEffectMountStarted(finishedWork);
23187 }
23188 } // Mount
23189
23190
23191 var create = effect.create;
23192
23193 {
23194 if ((flags & Insertion) !== NoFlags$1) {
23195 setIsRunningInsertionEffect(true);
23196 }
23197 }
23198
23199 effect.destroy = create();
23200
23201 {
23202 if ((flags & Insertion) !== NoFlags$1) {
23203 setIsRunningInsertionEffect(false);
23204 }
23205 }
23206
23207 {
23208 if ((flags & Passive$1) !== NoFlags$1) {
23209 markComponentPassiveEffectMountStopped();
23210 } else if ((flags & Layout) !== NoFlags$1) {
23211 markComponentLayoutEffectMountStopped();
23212 }
23213 }
23214
23215 {
23216 var destroy = effect.destroy;
23217
23218 if (destroy !== undefined && typeof destroy !== 'function') {
23219 var hookName = void 0;
23220
23221 if ((effect.tag & Layout) !== NoFlags) {
23222 hookName = 'useLayoutEffect';
23223 } else if ((effect.tag & Insertion) !== NoFlags) {
23224 hookName = 'useInsertionEffect';
23225 } else {
23226 hookName = 'useEffect';
23227 }
23228
23229 var addendum = void 0;

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…