Merge pull request #21458 from keplersj/next-js-with-router-hoc

Add withRouter HOC to next.js typedef
This commit is contained in:
Nathan Shively-Sanders
2017-11-17 16:16:04 -08:00
committed by GitHub
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -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;
+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 />);