bpms_site/.svn/pristine/ac/ac6d43a2d952766db632379d50d3c0788ec73055.svn-base
2025-11-02 16:38:49 +03:30

19 lines
747 B
Plaintext

import React from "react";
import { useRouter } from "./router";
export default function withRouter(ComposedComponent) {
function WithRouterWrapper(props) {
return /*#__PURE__*/ React.createElement(ComposedComponent, {
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