Files
DefinitelyTyped/react-router/lib/withRouter.d.ts
T
('3')andMohamed Hegazy 2c98442b6f react-router: Improve typing of withRouter (#15144)
* Improve typing of withRouter

Hoist typings of static methods.

* Fix declaration order

* Add test case
2017-03-13 10:28:21 -07:00

13 lines
433 B
TypeScript

import { ComponentClass, StatelessComponent } from "react";
interface Options {
withRef?: boolean;
}
type ComponentConstructor<P> = ComponentClass<P> | StatelessComponent<P>;
declare function withRouter<P, S>(component: ComponentConstructor<P> & S, options?: Options): ComponentClass<P> & S;
declare function withRouter<P>(component: ComponentConstructor<P>, options?: Options): ComponentClass<P>;
export default withRouter;