From 0e0bef8276d66cd32d416ff7698c2ae7afb361b5 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 10 Feb 2017 12:25:50 +0000 Subject: [PATCH 1/3] react-router added routes to RouteComponentProps --- react-router/lib/Router.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react-router/lib/Router.d.ts b/react-router/lib/Router.d.ts index 95b2e38267..aba09a19a3 100644 --- a/react-router/lib/Router.d.ts +++ b/react-router/lib/Router.d.ts @@ -90,6 +90,7 @@ export interface RouteComponentProps { params: P & R; route: PlainRoute; router: InjectedRouter; + routes: PlainRoute[]; routeParams: R; } From b274efe1be35f09854bf64f4d456f4fd87a94d56 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 10 Feb 2017 12:31:25 +0000 Subject: [PATCH 2/3] Update react-router-tests.tsx --- react-router/react-router-tests.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index 79e9012d53..de3450e803 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -93,10 +93,12 @@ class NotFound extends React.Component<{}, {}> { } +interface UsersProps extends RouteComponentProps<{}, {}> { } -class Users extends React.Component<{}, {}> { +class Users extends React.Component { render() { + const { location, params, routes, routes, router, routeParams } = this.props; return
This is a user list
From 844f14e366b9c2dab783537c17b25d680742e532 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Fri, 10 Feb 2017 12:45:15 +0000 Subject: [PATCH 3/3] Update react-router-tests.tsx --- react-router/react-router-tests.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index de3450e803..59186914e4 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -18,7 +18,8 @@ import { Link, RouterContext, LinkProps, - RedirectFunction + RedirectFunction, + RouteComponentProps } from "react-router"; const NavLink = (props: LinkProps) => ( @@ -98,7 +99,7 @@ interface UsersProps extends RouteComponentProps<{}, {}> { } class Users extends React.Component { render() { - const { location, params, routes, routes, router, routeParams } = this.props; + const { location, params, route, routes, router, routeParams } = this.props; return
This is a user list