mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
improve static router props context (#26541)
This commit is contained in:
8
types/react-router/index.d.ts
vendored
8
types/react-router/index.d.ts
vendored
@@ -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> { }
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user