UNPKG

@gechiui/block-editor

Version:
31 lines (25 loc) 506 B
/** * GeChiUI dependencies */ import { Component } from '@gechiui/element'; class BlockCrashBoundary extends Component { constructor() { super(...arguments); this.state = { hasError: false }; } componentDidCatch() { this.setState({ hasError: true }); } render() { if (this.state.hasError) { return this.props.fallback; } return this.props.children; } } export default BlockCrashBoundary; //# sourceMappingURL=block-crash-boundary.js.map