mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #21458 from keplersj/next-js-with-router-hoc
Add withRouter HOC to next.js typedef
This commit is contained in:
Vendored
+2
@@ -35,5 +35,7 @@ export interface SingletonRouter {
|
||||
onRouteChangeError?(error: any, url: string): void;
|
||||
}
|
||||
|
||||
export function withRouter<T extends {}>(Component: React.ComponentType<T & {router: SingletonRouter}>): React.ComponentType<T>;
|
||||
|
||||
export const Singleton: SingletonRouter;
|
||||
export default Singleton;
|
||||
|
||||
@@ -51,3 +51,5 @@ Router.replace('/route', '/asRoute', {shallow: false}).then((success: boolean) =
|
||||
Router.prefetch('/route').then(Component => {
|
||||
const element = (<Component />);
|
||||
});
|
||||
|
||||
r.withRouter(props => <div />);
|
||||
|
||||
Reference in New Issue
Block a user