diff --git a/src/load.ts b/src/load.ts index 527dc89..ac3554e 100644 --- a/src/load.ts +++ b/src/load.ts @@ -1,5 +1,5 @@ import { html as htm } from 'haunted'; -import { RuleRet } from './match'; +import { RuleRet, BaseRoute } from './match'; const html: typeof htm = (arr, ...thru) => htm( @@ -42,7 +42,7 @@ export const load = pack: (params: Record) => T, tag: string | ((u: URL) => string) = tagFromPath ) => -

({ match }: P) => { +

({ match, route }: P) => { const url = match.url; const params = { ...match.result?.groups, @@ -51,6 +51,7 @@ export const load = return Promise.resolve(pack(params)).then(() => createElement(typeof tag === 'function' ? tag(url) : tag, { params, + route, }) ); };