@enonic/react-components
Version:
Library of React components for handling Enonic XP data and page components
2 lines (1 loc) • 546 B
JavaScript
"use client";import{c as t}from"./chunk-J42GJEXW.mjs";import"./chunk-PN3WU6U5.mjs";import{Component as n}from"react";import{jsx as a}from"react/jsx-runtime";var e=class extends n{constructor(r){super(r),this.state={hasError:!1,error:new Error}}static getDerivedStateFromError(r){return{hasError:!0}}componentDidCatch(r,i){this.setState({error:r})}render(){return this.state.hasError?a(this.props.Fallback,{error:this.state.error}):this.props.children}};function s({children:o,mode:r}){return a(e,{Fallback:t(r),children:o})}export{s as default};