Add withRouter HOC to next.js typedef

This commit is contained in:
Kepler Sticka-Jones
2017-11-12 12:15:37 -07:00
parent 9df54d39a0
commit 2e6ef3f6a4
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -32,5 +32,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;
+2
View File
@@ -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 />);