Skip to content

Commit

Permalink
fix: change type of Router children to nested VNode array (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
zetaraku authored Jun 27, 2024
1 parent 2398d3b commit 291fcb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { AnyComponent, FunctionComponent, VNode } from 'preact';

export const LocationProvider: FunctionComponent;

type NestedArray<T> = Array<T | NestedArray<T>>;

export function Router(props: {
onRouteChange?: (url: string) => void;
onLoadEnd?: (url: string) => void;
onLoadStart?: (url: string) => void;
children?: VNode[];
children?: NestedArray<VNode>;
}): VNode;

interface LocationHook {
Expand Down

0 comments on commit 291fcb1

Please sign in to comment.