UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

36 lines (35 loc) 629 B
import { jsx as s } from "react/jsx-runtime"; import n from "react"; import a from "./GenericError.js"; const c = (t, r) => { console.error(t, r); }; class u extends n.Component { constructor(r) { super(r), this.state = { hasError: !1, error: null }; } static getDerivedStateFromError(r) { return { hasError: !0, error: r }; } componentDidCatch(r, o) { c(r, o); } render() { const { children: r } = this.props, { hasError: o, error: e } = this.state; return o ? /* @__PURE__ */ s(a, { error: e }) : r; } } export { u as default };