diff --git a/react-router/lib/withRouter.d.ts b/react-router/lib/withRouter.d.ts index 25f9d357c7..209c01f913 100644 --- a/react-router/lib/withRouter.d.ts +++ b/react-router/lib/withRouter.d.ts @@ -6,4 +6,7 @@ interface Options { type ComponentConstructor

= ComponentClass

| StatelessComponent

; -export default function withRouter

(component: ComponentConstructor

, options?: Options): ComponentClass

; +declare function withRouter(component: ComponentConstructor

& S, options?: Options): ComponentClass

& S; +declare function withRouter

(component: ComponentConstructor

, options?: Options): ComponentClass

; + +export default withRouter; diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index 8d7fd05178..314c78c6ce 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -81,6 +81,7 @@ interface DashboardProps { } class Dashboard extends React.Component { + static staticMethodToBeHoisted(): void {} navigate() { var router = this.props.router; @@ -102,6 +103,8 @@ class Dashboard extends React.Component { const DashboardWithRouter = withRouter(Dashboard); +DashboardWithRouter.staticMethodToBeHoisted(); + class NotFound extends React.Component<{}, {}> { render() {