import { jsx } from "react/jsx-runtime";
import { Component } from "react";
class ErrorBoundary extends Component {
  static getDerivedStateFromError() {
    return { hasError: true };
  }
  state = { hasError: false };
  render() {
    const { FallbackComponent } = this.props;
    if (this.state.hasError)
      return FallbackComponent ? /* @__PURE__ */ jsx(FallbackComponent, {}) : null;
    return this.props.children;
  }
}
export {
  ErrorBoundary
};
//# sourceMappingURL=ErrorBoundary.js.map