@samitouri / QOS-React-1 / commits / 053b3cb050

[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

lauren committed Nov 15, 2024 at 17:50 UTC 053b3cb0503e26da6d1dfa02b74fa52e30936bd6
1 file changed +6 -1
packages/react-reconciler/src/ReactFiberHooks.js
+6 -1
@@ -218,7 +218,8 @@ type EffectInstance = {
218 destroy: void | (() => void),
219 };
220
221 -export type Effect = {
221 +export type Effect = SimpleEffect;
222 +export type SimpleEffect = {
223 tag: HookFlags,
224 create: () => (() => void) | void,
225 inst: EffectInstance,
@@ -2522,6 +2523,10 @@ function pushEffect(
2523 // Circular
2524 next: (null: any),
2525 };
2526 + return pushEffectImpl(effect);
2527 +}
2528 +
2529 +function pushEffectImpl(effect: Effect): Effect {
2530 let componentUpdateQueue: null | FunctionComponentUpdateQueue =
2531 (currentlyRenderingFiber.updateQueue: any);
2532 if (componentUpdateQueue === null) {