UNPKG

@embrace-io/web-sdk

Version:
3 lines (2 loc) 976 B
import t from"react";import r from"hoist-non-react-statics";import"../../NavigationInstrumentation.js";import{getNavigationInstrumentation as o}from"../../instance.js";import{EMB_NAVIGATION_INSTRUMENTATIONS as a}from"../../../../../constants/attributes.js";var e=function(t,r){var o;if(!t.props.match||!t.props.match.route)return null;var a=r?"".concat(r.path,"/").concat(t.props.match.route.path):t.props.match.route.path;return(null===(o=t.props.routeContext)||void 0===o?void 0:o.outlet)?e(t.props.routeContext.outlet,{path:a,url:t.props.match.pathname}):{path:a,url:t.props.match.pathname}},n=function(n){var p=o();p.setInstrumentationType(a.Declarative);var m=function(r){var o=n(r);if(o.props.match&&o.props.match.route){var a=e(o,null);a&&p.setCurrentRoute(a)}return t.createElement(n,r)};return m.displayName="withEmbraceRouting(".concat(n.displayName||n.name||"Component",")"),r(m,n),m};export{n as withEmbraceRouting}; //# sourceMappingURL=withEmbraceRouting.js.map