Skip to content

Commit 053b3cb

Browse files
authored
[crud] Rename Effect type (#31557)
Adds a new `Effect` type which for now just points to the `SimpleEffect` type, in prepartion for later in the stack where we add more. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31557). * #31523 * __->__ #31557 * #31556 * #31555
1 parent 7dd6b9e commit 053b3cb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/react-reconciler/src/ReactFiberHooks.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ type EffectInstance = {
218218
destroy: void | (() => void),
219219
};
220220

221-
export type Effect = {
221+
export type Effect = SimpleEffect;
222+
export type SimpleEffect = {
222223
tag: HookFlags,
223224
create: () => (() => void) | void,
224225
inst: EffectInstance,
@@ -2522,6 +2523,10 @@ function pushEffect(
25222523
// Circular
25232524
next: (null: any),
25242525
};
2526+
return pushEffectImpl(effect);
2527+
}
2528+
2529+
function pushEffectImpl(effect: Effect): Effect {
25252530
let componentUpdateQueue: null | FunctionComponentUpdateQueue =
25262531
(currentlyRenderingFiber.updateQueue: any);
25272532
if (componentUpdateQueue === null) {

0 commit comments

Comments
 (0)