diff --git a/src/runtime/internal/lifecycle.ts b/src/runtime/internal/lifecycle.ts index faaeac2988e..4eacb698d62 100644 --- a/src/runtime/internal/lifecycle.ts +++ b/src/runtime/internal/lifecycle.ts @@ -34,9 +34,9 @@ type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ( type ExtractObjectValues> = Object[keyof Object] type ConstructDispatchFunction, EventKey extends keyof EventMap> = - EventMap[EventKey] extends never + EventMap[EventKey] extends never | null ? (type: EventKey) => void - : undefined extends EventMap[EventKey] + : null extends EventMap[EventKey] ? (type: EventKey, detail?: EventMap[EventKey]) => void : (type: EventKey, detail: EventMap[EventKey]) => void