Files
old-kitabcitab-frontend/kitabcitab/node_modules/next/dist/esm/client/with-router.js
2022-12-27 12:05:56 +01:00

18 lines
743 B
JavaScript

import React from 'react';
import { useRouter } from './router';
export default function withRouter(ComposedComponent) {
function WithRouterWrapper(props) {
return /*#__PURE__*/ React.createElement(ComposedComponent, Object.assign({
router: useRouter()
}, props));
}
WithRouterWrapper.getInitialProps = ComposedComponent.getInitialProps;
WithRouterWrapper.origGetInitialProps = ComposedComponent.origGetInitialProps;
if (process.env.NODE_ENV !== 'production') {
const name = ComposedComponent.displayName || ComposedComponent.name || 'Unknown';
WithRouterWrapper.displayName = `withRouter(${name})`;
}
return WithRouterWrapper;
};
//# sourceMappingURL=with-router.js.map