UNPKG

@grafana/faro-react

Version:

Faro package that enables easier integration in projects built with React.

13 lines 888 B
import { jsx as _jsx } from "react/jsx-runtime"; import hoistNonReactStatics from 'hoist-non-react-statics'; import { unknownString } from '@grafana/faro-core'; import { FaroErrorBoundary } from './FaroErrorBoundary'; export function withFaroErrorBoundary(WrappedComponent, errorBoundaryProps) { var _a, _b; const componentDisplayName = (_b = (_a = WrappedComponent.displayName) !== null && _a !== void 0 ? _a : WrappedComponent.name) !== null && _b !== void 0 ? _b : unknownString; const Component = (wrappedComponentProps) => (_jsx(FaroErrorBoundary, Object.assign({}, errorBoundaryProps, { children: _jsx(WrappedComponent, Object.assign({}, wrappedComponentProps)) }))); Component.displayName = `faroErrorBoundary(${componentDisplayName})`; hoistNonReactStatics(Component, WrappedComponent); return Component; } //# sourceMappingURL=withFaroErrorBoundary.js.map