improve static router props context (#26541)

This commit is contained in:
Duong Tran
2018-06-22 07:55:57 +10:00
committed by John Reilly
parent 2583acd483
commit 7bb66a4c3d
2 changed files with 9 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
// Youen Toupin <https://github.com/neuoy>
// Rahul Raina <https://github.com/rraina>
// Maksim Sharipov <https://github.com/pret-a-porter>
// Duong Tran <https://github.com/t49tran>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -86,10 +87,15 @@ export interface RouterProps {
}
export class Router extends React.Component<RouterProps, any> { }
export interface StaticRouterContext {
url?: string;
action?: 'PUSH' | 'REPLACE';
location?: object;
}
export interface StaticRouterProps {
basename?: string;
location?: string | object;
context?: object;
context?: StaticRouterContext;
}
export class StaticRouter extends React.Component<StaticRouterProps, any> { }

View File

@@ -1,7 +1,8 @@
import * as React from 'react';
import { StaticRouter, Route } from 'react-router-dom';
import { StaticRouterContext } from 'react-router';
interface StaticContext {
interface StaticContext extends StaticRouterContext {
statusCode?: number;
}