diff --git a/types/react-router/index.d.ts b/types/react-router/index.d.ts index cf5efbbb36..1bebd855f1 100644 --- a/types/react-router/index.d.ts +++ b/types/react-router/index.d.ts @@ -14,6 +14,7 @@ // Jérémy Fauvel // Daniel Roth // Egor Shulga +// Youen Toupin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 diff --git a/types/react-router/test/examples-from-react-router-website/CustomLink.tsx b/types/react-router/test/examples-from-react-router-website/CustomLink.tsx index f3b1fb180e..ef5173e97e 100644 --- a/types/react-router/test/examples-from-react-router-website/CustomLink.tsx +++ b/types/react-router/test/examples-from-react-router-website/CustomLink.tsx @@ -24,9 +24,9 @@ interface OldSchoolMenuLinkProps extends LinkProps { } const OldSchoolMenuLink: React.SFC = ({ label, to, activeOnlyWhenExact }) => ( - ( -
- {match ? '> ' : ''}{label} + ( +
+ {params.match ? '> ' : ''}{label}
)}/> ); diff --git a/types/react-router/v3/lib/IndexRoute.d.ts b/types/react-router/v3/lib/IndexRoute.d.ts index 9c82775c12..1132713b1a 100644 --- a/types/react-router/v3/lib/IndexRoute.d.ts +++ b/types/react-router/v3/lib/IndexRoute.d.ts @@ -12,9 +12,10 @@ import { type ComponentCallback = (err: any, component: RouteComponent) => any; type ComponentsCallback = (err: any, components: RouteComponents) => any; -export interface IndexRouteProps { +export interface IndexRouteProps { component?: RouteComponent; components?: RouteComponents; + props?: Props; getComponent?(nextState: RouterState, callback: ComponentCallback): void; getComponents?(nextState: RouterState, callback: ComponentsCallback): void; onEnter?: EnterHook; diff --git a/types/react-router/v3/lib/Route.d.ts b/types/react-router/v3/lib/Route.d.ts index 15aafebc75..a9ca90b42a 100644 --- a/types/react-router/v3/lib/Route.d.ts +++ b/types/react-router/v3/lib/Route.d.ts @@ -11,7 +11,7 @@ import { } from "react-router"; import { IndexRouteProps } from "react-router/lib/IndexRoute"; -export interface RouteProps extends IndexRouteProps { +export interface RouteProps extends IndexRouteProps { path?: RoutePattern; } @@ -23,7 +23,7 @@ export default Route; type RouteCallback = (err: any, route: PlainRoute) => void; type RoutesCallback = (err: any, routesArray: PlainRoute[]) => void; -export interface PlainRoute extends RouteProps { +export interface PlainRoute extends RouteProps { childRoutes?: PlainRoute[]; getChildRoutes?(partialNextState: LocationState, callback: RoutesCallback): void; indexRoute?: PlainRoute; diff --git a/types/react-router/v3/lib/Router.d.ts b/types/react-router/v3/lib/Router.d.ts index 02550026b9..55072a140e 100644 --- a/types/react-router/v3/lib/Router.d.ts +++ b/types/react-router/v3/lib/Router.d.ts @@ -66,10 +66,10 @@ export interface InjectedRouter { isActive: ActiveFunction; } -export interface RouteComponentProps { +export interface RouteComponentProps { location: Location; params: P & R; - route: PlainRoute; + route: PlainRoute; router: InjectedRouter; routes: PlainRoute[]; routeParams: R;