Skip to content

Commit

Permalink
[crud] Rename Effect type (#31557)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
poteto authored Nov 15, 2024
1 parent 7dd6b9e commit 053b3cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/react-reconciler/src/ReactFiberHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 053b3cb

Please sign in to comment.