MCPcopy Create free account
hub / github.com/microsoft/SandDance / updateEffectImpl

Function updateEffectImpl

docs/external/js/react-dom.development.js:15436–15457  ·  view source on GitHub ↗
(fiberEffectTag, hookEffectTag, create, deps)

Source from the content-addressed store, hash-verified

15434 }
15435
15436 function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
15437 var hook = updateWorkInProgressHook();
15438 var nextDeps = deps === undefined ? null : deps;
15439 var destroy = undefined;
15440
15441 if (currentHook !== null) {
15442 var prevEffect = currentHook.memoizedState;
15443 destroy = prevEffect.destroy;
15444
15445 if (nextDeps !== null) {
15446 var prevDeps = prevEffect.deps;
15447
15448 if (areHookInputsEqual(nextDeps, prevDeps)) {
15449 pushEffect(hookEffectTag, create, destroy, nextDeps);
15450 return;
15451 }
15452 }
15453 }
15454
15455 currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
15456 hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, destroy, nextDeps);
15457 }
15458
15459 function mountEffect(create, deps) {
15460 {

Callers 3

updateEffectFunction · 0.85
updateLayoutEffectFunction · 0.85
updateImperativeHandleFunction · 0.85

Calls 3

updateWorkInProgressHookFunction · 0.85
areHookInputsEqualFunction · 0.85
pushEffectFunction · 0.85

Tested by

no test coverage detected