UNPKG

@ui-schema/react

Version:

Schema-driven UI generator for React using JSON Schema. Build powerful form and interface generators with headless components and hooks.

27 lines 670 B
import * as React from 'react'; import { jsx as _jsx } from "react/jsx-runtime"; export class WidgetEngineErrorBoundary extends React.Component { state = { error: null }; static getDerivedStateFromError(error) { return { error: error }; } componentDidCatch(error, info) { console.error(error, info); } render() { if (this.state.error) { const FallbackComponent = this.props.FallbackComponent; return _jsx(FallbackComponent, { error: this.state.error, type: this.props.type, widget: this.props.widget, storeKeys: this.props.storeKeys }); } return this.props.children; } }