From 053b3cb0503e26da6d1dfa02b74fa52e30936bd6 Mon Sep 17 00:00:00 2001 From: lauren Date: Fri, 15 Nov 2024 17:50:50 -0500 Subject: [PATCH] [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 --- packages/react-reconciler/src/ReactFiberHooks.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-reconciler/src/ReactFiberHooks.js b/packages/react-reconciler/src/ReactFiberHooks.js index 174235fc76d65..2e4f23dd7bd61 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.js +++ b/packages/react-reconciler/src/ReactFiberHooks.js @@ -218,7 +218,8 @@ type EffectInstance = { destroy: void | (() => void), }; -export type Effect = { +export type Effect = SimpleEffect; +export type SimpleEffect = { tag: HookFlags, create: () => (() => void) | void, inst: EffectInstance, @@ -2522,6 +2523,10 @@ function pushEffect( // Circular next: (null: any), }; + return pushEffectImpl(effect); +} + +function pushEffectImpl(effect: Effect): Effect { let componentUpdateQueue: null | FunctionComponentUpdateQueue = (currentlyRenderingFiber.updateQueue: any); if (componentUpdateQueue === null) {