Skip to content

Commit 291fcb1

Browse files
authored
fix: change type of Router children to nested VNode array (#30)
1 parent 2398d3b commit 291fcb1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/router.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import { AnyComponent, FunctionComponent, VNode } from 'preact';
22

33
export const LocationProvider: FunctionComponent;
44

5+
type NestedArray<T> = Array<T | NestedArray<T>>;
6+
57
export function Router(props: {
68
onRouteChange?: (url: string) => void;
79
onLoadEnd?: (url: string) => void;
810
onLoadStart?: (url: string) => void;
9-
children?: VNode[];
11+
children?: NestedArray<VNode>;
1012
}): VNode;
1113

1214
interface LocationHook {

0 commit comments

Comments
 (0)