UNPKG

@winglet/react-utils

Version:

React utility library providing custom hooks, higher-order components (HOCs), and utility functions to enhance React application development with improved reusability and functionality

11 lines (7 loc) 363 B
'use strict'; var jsxRuntime = require('react/jsx-runtime'); var ErrorBoundary = require('./ErrorBoundary.cjs'); const withErrorBoundary = (Component, fallback) => { return (props) => (jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { fallback: fallback, children: jsxRuntime.jsx(Component, { ...props }) })); }; exports.withErrorBoundary = withErrorBoundary;