UNPKG

@embrace-io/web-sdk

Version:
27 lines (26 loc) 1.36 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs"); const require_api_page_pageAPI = require("../../../../../api-page/pageAPI.cjs"); let react = require("react"); react = require_runtime.__toESM(react, 1); let hoist_non_react_statics = require("hoist-non-react-statics"); hoist_non_react_statics = require_runtime.__toESM(hoist_non_react_statics, 1); //#region src/instrumentations/navigation/NavigationInstrumentation/react/reactRouterV5/withEmbraceRoutingLegacy.ts const withEmbraceRoutingLegacy = (WrappedComponent) => { const RouteWithEmbraceRoutingLegacy = (props) => { if (props.path) { const routeProps = props; if (routeProps.computedMatch) require_api_page_pageAPI.page.setCurrentRoute({ path: routeProps.computedMatch.path, url: routeProps.computedMatch.url }); } return react.createElement(WrappedComponent, props); }; RouteWithEmbraceRoutingLegacy.displayName = `withEmbraceRoutingLegacy(${WrappedComponent.displayName || WrappedComponent.name || "Component"})`; (0, hoist_non_react_statics.default)(RouteWithEmbraceRoutingLegacy, WrappedComponent); return RouteWithEmbraceRoutingLegacy; }; //#endregion exports.withEmbraceRoutingLegacy = withEmbraceRoutingLegacy; //# sourceMappingURL=withEmbraceRoutingLegacy.cjs.map