Skip to content

Commit

Permalink
compiler: fix the hookKind for useInsertionEffect (#30069)
Browse files Browse the repository at this point in the history
Currently, the `hookKind` for `useInsertionEffect` is set to
`useLayoutEffect`. This pull request fixes it by adding a new `hookKind`
for `useInsertionEffect`.
  • Loading branch information
saul-atomrigs authored Jun 26, 2024
1 parent bbc8851 commit 7baae65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ const REACT_APIS: Array<[string, BuiltInType]> = [
restParam: Effect.Freeze,
returnType: { kind: "Poly" },
calleeEffect: Effect.Read,
hookKind: "useLayoutEffect",
hookKind: "useInsertionEffect",
returnValueKind: ValueKind.Frozen,
},
BuiltInUseInsertionEffectHookId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export type HookKind =
| "useRef"
| "useEffect"
| "useLayoutEffect"
| "useInsertionEffect"
| "useMemo"
| "useCallback"
| "Custom";
Expand Down

0 comments on commit 7baae65

Please sign in to comment.