UNPKG

@exabytellc/app

Version:

EB react app to make everything a little easier!

36 lines 994 B
import React, { Suspense } from "react"; import ErrorBoundary from "./components/ErrorBoundary"; import PropTypes from "prop-types"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export default function AppBoundary(_ref) { let { FallbackError = _ref2 => { let { error } = _ref2; return /*#__PURE__*/_jsxs("div", { children: [/*#__PURE__*/_jsx("h2", { children: "Error occurred." }), /*#__PURE__*/_jsx("pre", { children: error })] }); }, FallbackLoading = () => /*#__PURE__*/_jsx("div", { children: "Loading..." }), children } = _ref; return /*#__PURE__*/_jsx(ErrorBoundary, { fallback: FallbackError, children: /*#__PURE__*/_jsx(Suspense, { fallback: /*#__PURE__*/_jsx(FallbackLoading, {}), children: children }) }); } AppBoundary.propTypes = { FallbackError: PropTypes.func, FallbackLoading: PropTypes.func, children: PropTypes.node };