diff --git a/types/next/router.d.ts b/types/next/router.d.ts index 3072455e45..2b019625f6 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -90,8 +90,12 @@ export interface WithRouterProps { router: SingletonRouter; } -export function withRouter( - Component: React.ComponentType, +// Manually disabling the no-unnecessary-generics rule so users can +// retain type inference if they warp their component in withRouter +// without defining props explicitly +export function withRouter( + // tslint:disable-next-line:no-unnecessary-generics + Component: React.ComponentType>, ): React.ComponentType; declare const Router: SingletonRouter;