Class: KataErrorBoundary
Defined in: packages/kata-react/src/KataErrorBoundary.tsx:25
Extends
Component<KataErrorBoundaryProps,KataErrorBoundaryState>
Constructors
Constructor
new KataErrorBoundary(props): KataErrorBoundary;
Defined in: node_modules/.bun/@types+react@19.2.13/node_modules/@types/react/index.d.ts:950
Parameters
props
Returns
KataErrorBoundary
Inherited from
Component<KataErrorBoundaryProps, KataErrorBoundaryState>.constructor
Constructor
new KataErrorBoundary(props, context): KataErrorBoundary;
Defined in: node_modules/.bun/@types+react@19.2.13/node_modules/@types/react/index.d.ts:958
Parameters
props
context
any
value of the parent Context specified
in contextType.
Returns
KataErrorBoundary
Inherited from
Component<KataErrorBoundaryProps, KataErrorBoundaryState>.constructor
Properties
context
context: KataContextType | null;
Defined in: packages/kata-react/src/KataErrorBoundary.tsx:27
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
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>
See
Overrides
Component.context
state
state: KataErrorBoundaryState;
Defined in: packages/kata-react/src/KataErrorBoundary.tsx:29
Overrides
Component.state
contextType
static contextType: Context<KataContextType | null> = KataContext;
Defined in: packages/kata-react/src/KataErrorBoundary.tsx:26
If set, this.context will be set at runtime to the current value of the given Context.
Example
type MyContext = number
const 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}</>;
}
}
See
https://react.dev/reference/react/Component#static-contexttype
Overrides
Component.contextType
Methods
componentDidCatch()
componentDidCatch(error, errorInfo): void;
Defined in: packages/kata-react/src/KataErrorBoundary.tsx:35
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Parameters
error
Error
errorInfo
ErrorInfo
Returns
void
Overrides
Component.componentDidCatch
render()
render(): ReactNode;
Defined in: packages/kata-react/src/KataErrorBoundary.tsx:81
Returns
ReactNode
Overrides
Component.render
getDerivedStateFromError()
static getDerivedStateFromError(error): KataErrorBoundaryState;
Defined in: packages/kata-react/src/KataErrorBoundary.tsx:31
Parameters
error
Error
Returns
KataErrorBoundaryState