= {
+ router: React.PropTypes.object
+ };
+ context: MasterContext;
+
+ navigate() {
+ var router = this.context.router;
+ router.push("/users");
+ router.push({
+ pathname: "/users/12",
+ query: { modal: true },
+ state: { fromDashboard: true }
+ });
+ }
+
render() {
return
Master
diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts
index 9f8699481..e87622e9b 100644
--- a/react-router/react-router.d.ts
+++ b/react-router/react-router.d.ts
@@ -1,6 +1,6 @@
-// Type definitions for react-router v2.0.0-rc5
+// Type definitions for react-router v2.0.0
// Project: https://github.com/rackt/react-router
-// Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík
+// Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík , Nathan Brown
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -195,6 +195,10 @@ declare namespace ReactRouter {
interface IndexRedirectElement extends React.ReactElement {}
const IndexRedirect: IndexRedirect
+ interface RouterOnContext extends H.History {
+ setRouteLeaveHook(route: PlainRoute, hook?: RouteHook): () => void;
+ isActive(pathOrLoc: H.LocationDescriptor, indexOnly?: boolean): boolean;
+ }
/* mixins */
@@ -448,6 +452,7 @@ declare module "react-router" {
export type RouterListener = ReactRouter.RouterListener
export type RouterState = ReactRouter.RouterState
export type HistoryBase = ReactRouter.HistoryBase
+ export type RouterOnContext = ReactRouter.RouterOnContext
export {
Router,