ErrorBoundary Class — react Architecture
Architecture documentation for the ErrorBoundary class in ReactSuspenseWithNoopRenderer-test.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD d5c67e53_a449_6859_9450_04ef19170e50["ErrorBoundary"] aebda27b_75ef_20d7_b451_43162e398a18["ReactSuspenseWithNoopRenderer-test.js"] d5c67e53_a449_6859_9450_04ef19170e50 -->|defined in| aebda27b_75ef_20d7_b451_43162e398a18 23c52917_10a5_66c7_0715_5b91825f67ec["componentDidCatch()"] d5c67e53_a449_6859_9450_04ef19170e50 -->|method| 23c52917_10a5_66c7_0715_5b91825f67ec f73a897e_b148_60ef_13de_7036a7637f51["reset()"] d5c67e53_a449_6859_9450_04ef19170e50 -->|method| f73a897e_b148_60ef_13de_7036a7637f51 1193fcea_5108_fed8_adff_cbcfa7c7683c["render()"] d5c67e53_a449_6859_9450_04ef19170e50 -->|method| 1193fcea_5108_fed8_adff_cbcfa7c7683c f9bf7dbc_7b6d_79b5_646b_7cebe1e2a853["getDerivedStateFromError()"] d5c67e53_a449_6859_9450_04ef19170e50 -->|method| f9bf7dbc_7b6d_79b5_646b_7cebe1e2a853
Relationship Graph
Source Code
packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js lines 424–438
class ErrorBoundary extends React.Component {
state = {error: null};
componentDidCatch(error) {
this.setState({error});
}
reset() {
this.setState({error: null});
}
render() {
if (this.state.error !== null) {
return <Text text={'Caught error: ' + this.state.error.message} />;
}
return this.props.children;
}
}
Source
Frequently Asked Questions
What is the ErrorBoundary class?
ErrorBoundary is a class in the react codebase, defined in packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js.
Where is ErrorBoundary defined?
ErrorBoundary is defined in packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js at line 424.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free