diff --git a/types/next/router.d.ts b/types/next/router.d.ts index a1d58bb42a..9f937ca6ba 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -35,5 +35,7 @@ export interface SingletonRouter { onRouteChangeError?(error: any, url: string): void; } +export function withRouter(Component: React.ComponentType): React.ComponentType; + export const Singleton: SingletonRouter; export default Singleton; diff --git a/types/next/test/next-router-tests.tsx b/types/next/test/next-router-tests.tsx index 37e739d98a..e713f127b7 100644 --- a/types/next/test/next-router-tests.tsx +++ b/types/next/test/next-router-tests.tsx @@ -51,3 +51,5 @@ Router.replace('/route', '/asRoute', {shallow: false}).then((success: boolean) = Router.prefetch('/route').then(Component => { const element = (); }); + +r.withRouter(props =>
);