ErrorBoundary
Defined in: packages/ui-react/src/components/ErrorBoundary.tsx:43
Extends
Section titled “Extends”Component<ErrorBoundaryProps,State>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ErrorBoundary(
props):ErrorBoundary
Defined in: node_modules/.pnpm/@types+react@19.2.17/node_modules/@types/react/index.d.ts:958
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ErrorBoundary
Inherited from
Section titled “Inherited from”React.Component<ErrorBoundaryProps, State>.constructor
Constructor
Section titled “Constructor”new ErrorBoundary(
props,context):ErrorBoundary
Defined in: node_modules/.pnpm/@types+react@19.2.17/node_modules/@types/react/index.d.ts:966
Parameters
Section titled “Parameters”context
Section titled “context”any
value of the parent Context specified
in contextType.
Returns
Section titled “Returns”ErrorBoundary
Inherited from
Section titled “Inherited from”React.Component<ErrorBoundaryProps, State>.constructor
Properties
Section titled “Properties”contextType
Section titled “contextType”
staticcontextType:Context<WorkspaceI18nContextValue|null> =WorkspaceI18nContext
Defined in: packages/ui-react/src/components/ErrorBoundary.tsx:44
If set, this.context will be set at runtime to the current value of the given Context.
Example
Section titled “Example”type MyContext = numberconst Ctx = React.createContext<MyContext>(0)
class Foo extends React.Component { static contextType = Ctx context!: React.ContextType<typeof Ctx> render () { return <>My context's value: {this.context}</>; }}https://react.dev/reference/react/Component#static-contexttype
Overrides
Section titled “Overrides”React.Component.contextType
context
Section titled “context”context:
WorkspaceI18nContextValue|null
Defined in: packages/ui-react/src/components/ErrorBoundary.tsx:45
If using React Context, re-declare this in your class to be the
React.ContextType of your static contextType.
Should be used with type annotation or static contextType.
Example
Section titled “Example”static contextType = MyContext// For TS pre-3.7:context!: React.ContextType<typeof MyContext>// For TS 3.7 and above:declare context: React.ContextType<typeof MyContext>Overrides
Section titled “Overrides”React.Component.context
state:
State
Defined in: packages/ui-react/src/components/ErrorBoundary.tsx:47
Overrides
Section titled “Overrides”React.Component.state
Methods
Section titled “Methods”getDerivedStateFromError()
Section titled “getDerivedStateFromError()”
staticgetDerivedStateFromError(error):State
Defined in: packages/ui-react/src/components/ErrorBoundary.tsx:49
Parameters
Section titled “Parameters”Error
Returns
Section titled “Returns”State
componentDidCatch()
Section titled “componentDidCatch()”componentDidCatch(
error,info):void
Defined in: packages/ui-react/src/components/ErrorBoundary.tsx:53
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Parameters
Section titled “Parameters”Error
ErrorInfo
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”React.Component.componentDidCatch
reset()
Section titled “reset()”reset():
void
Defined in: packages/ui-react/src/components/ErrorBoundary.tsx:61
Returns
Section titled “Returns”void
render()
Section titled “render()”render():
string|number|bigint|boolean|Iterable<ReactNode,any,any> |Promise<AwaitedReactNode> |Element|null|undefined
Defined in: packages/ui-react/src/components/ErrorBoundary.tsx:65
Returns
Section titled “Returns”string | number | bigint | boolean | Iterable<ReactNode, any, any> | Promise<AwaitedReactNode> | Element | null | undefined
Overrides
Section titled “Overrides”React.Component.render