diff --git a/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts b/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts index 895a7f6d6d..94a89447fa 100644 --- a/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts +++ b/compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts @@ -100,7 +100,7 @@ export type Hook = z.infer; */ const EnvironmentConfigSchema = z.object({ - customHooks: z.map(z.string(), HookSchema).nullish(), + customHooks: z.map(z.string(), HookSchema).optional().default(new Map()), // 🌲 enableForest: z.boolean().default(false), @@ -315,7 +315,7 @@ export class Environment { this.#shapes = new Map(DEFAULT_SHAPES); this.config = config; - if (this.config.customHooks != null && this.config.customHooks.size > 0) { + if (this.config.customHooks.size > 0) { this.#globals = new Map(DEFAULT_GLOBALS); for (const [hookName, hook] of this.config.customHooks) { CompilerError.invariant(!this.#globals.has(hookName), {