diff --git a/compiler/forget/src/Inference/InferReferenceEffects.ts b/compiler/forget/src/Inference/InferReferenceEffects.ts index f748f0c98e..5b98328e98 100644 --- a/compiler/forget/src/Inference/InferReferenceEffects.ts +++ b/compiler/forget/src/Inference/InferReferenceEffects.ts @@ -835,9 +835,25 @@ const HOOKS: Map = new Map([ valueKind: ValueKind.Frozen, }, ], + [ + "useMemo", + { + kind: "Memo", + effectKind: Effect.Freeze, + valueKind: ValueKind.Frozen, + }, + ], + [ + "useCallback", + { + kind: "Memo", + effectKind: Effect.Freeze, + valueKind: ValueKind.Frozen, + }, + ], ]); -type HookKind = "State" | "Ref" | "Custom"; +type HookKind = "State" | "Ref" | "Custom" | "Memo"; type Hook = { kind: HookKind; effectKind: Effect; valueKind: ValueKind }; export function parseHookCall(place: Place): Hook | null {