From a4fbf16eef788294111d810bc4260b7ee93a288f Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Tue, 28 Dec 2021 20:36:11 +0100 Subject: [PATCH] fix: mark render method in RouteResolver as optional (#3235) --- js/src/common/Application.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/src/common/Application.tsx b/js/src/common/Application.tsx index b966fc1cc..e9c930d4c 100644 --- a/js/src/common/Application.tsx +++ b/js/src/common/Application.tsx @@ -106,14 +106,21 @@ export interface RouteResolver< * * Returns the component class, and **not** a Vnode or JSX * expression. + * + * @see https://mithril.js.org/route.html#routeresolveronmatch */ onmatch(this: this, args: RouteArgs, requestedPath: string, route: string): { new (): Comp }; /** * A function which renders the provided component. * + * If not specified, the route will default to rendering the + * component on its own, inside of a fragment. + * * Returns a Mithril Vnode or other children. + * + * @see https://mithril.js.org/route.html#routeresolverrender */ - render(this: this, vnode: Mithril.Vnode): Mithril.Children; + render?(this: this, vnode: Mithril.Vnode): Mithril.Children; } /**