Files
SnowLuma/.pnpm-store/v11/files/01/493fe8be31dd03bac612489adc53cb2279d627ee270954af39f32f18fc469e809fd1b53a49dee2caf85cbf95ecb04ba69b45a0b9bb9613c59baac8d4bd8b3b
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

27 lines
969 B
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_jsx_constants = require("../constants.js");
const require_jsx_dom_jsx_dev_runtime = require("./jsx-dev-runtime.js");
require("./jsx-runtime.js");
//#region src/jsx/dom/components.ts
const ErrorBoundary = (({ children, fallback, fallbackRender, onError }) => {
const res = require_jsx_dom_jsx_dev_runtime.Fragment({ children });
res[require_jsx_constants.DOM_ERROR_HANDLER] = (err) => {
if (err instanceof Promise) throw err;
onError?.(err);
return fallbackRender?.(err) || fallback;
};
return res;
});
const Suspense = (({ children, fallback }) => {
const res = require_jsx_dom_jsx_dev_runtime.Fragment({ children });
res[require_jsx_constants.DOM_ERROR_HANDLER] = (err, retry) => {
if (!(err instanceof Promise)) throw err;
err.finally(retry);
return fallback;
};
return res;
});
//#endregion
exports.ErrorBoundary = ErrorBoundary;
exports.Suspense = Suspense;