diff --git a/src/compat.ts b/src/compat.ts index f6c3887c..f85ea088 100644 --- a/src/compat.ts +++ b/src/compat.ts @@ -1,4 +1,4 @@ -import type { VNode } from "preact"; +import type { ComponentChildren } from "preact"; import type { FreshContext } from "./context.ts"; import type { HandlerFn, RouteHandler } from "./handlers.ts"; @@ -46,10 +46,16 @@ export type Handler> = HandlerFn< function defineFn( fn: ( ctx: FreshContext, - ) => Response | VNode | null | Promise, + ) => + | ComponentChildren + | Response + | Promise, ): ( ctx: FreshContext, -) => Response | VNode | null | Promise { +) => + | ComponentChildren + | Response + | Promise { return fn; }