Skip to content

Commit

Permalink
Typescript 2.4 compatibility (#210)
Browse files Browse the repository at this point in the history
Not sure exactly why this worked before, but it seems 2.4 is slightly
more strict about definitions
  • Loading branch information
Alexendoo authored and developit committed Jul 12, 2017
1 parent 1d1f520 commit eb9cedf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ export class Router extends preact.Component<RouterProps, {}> {
render(props: RouterProps, {}): preact.VNode;
}

export interface RouteProps<C> extends RoutableProps {
component: preact.AnyComponent<C, any>;
type AnyComponent<Props> =
| preact.FunctionalComponent<Props>
| preact.ComponentConstructor<Props, any>;

export interface RouteProps<Props> extends RoutableProps {
component: AnyComponent<Props>;
}

export function Route<Props>(
Expand Down

0 comments on commit eb9cedf

Please sign in to comment.