Home / Class/ ErrorBoundaryWithBothMethods Class — react Architecture

ErrorBoundaryWithBothMethods Class — react Architecture

Architecture documentation for the ErrorBoundaryWithBothMethods class in ReactErrorBoundaries-test.internal.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  894e4daf_f004_9778_83eb_06aec483c262["ErrorBoundaryWithBothMethods"]
  e3be826d_2e6e_c7e0_1926_386d40353a30["ReactErrorBoundaries-test.internal.js"]
  894e4daf_f004_9778_83eb_06aec483c262 -->|defined in| e3be826d_2e6e_c7e0_1926_386d40353a30
  c69661c2_2820_3401_4ee6_b35da49ae7ec["getDerivedStateFromError()"]
  894e4daf_f004_9778_83eb_06aec483c262 -->|method| c69661c2_2820_3401_4ee6_b35da49ae7ec
  c637e05c_30db_3f10_ef4e_b5c896365870["componentDidCatch()"]
  894e4daf_f004_9778_83eb_06aec483c262 -->|method| c637e05c_30db_3f10_ef4e_b5c896365870
  d437995a_bba2_049c_fd72_371c8f5b3d41["render()"]
  894e4daf_f004_9778_83eb_06aec483c262 -->|method| d437995a_bba2_049c_fd72_371c8f5b3d41

Relationship Graph

Source Code

packages/react-dom/src/__tests__/ReactErrorBoundaries-test.internal.js lines 2578–2590

    class ErrorBoundaryWithBothMethods extends React.Component {
      state = {error: null};
      static getDerivedStateFromError(error) {
        getDerivedStateFromErrorError = error;
        return {error};
      }
      componentDidCatch(error, info) {
        componentDidCatchError = error;
      }
      render() {
        return this.state.error ? 'ErrorBoundary' : this.props.children;
      }
    }

Frequently Asked Questions

What is the ErrorBoundaryWithBothMethods class?
ErrorBoundaryWithBothMethods is a class in the react codebase, defined in packages/react-dom/src/__tests__/ReactErrorBoundaries-test.internal.js.
Where is ErrorBoundaryWithBothMethods defined?
ErrorBoundaryWithBothMethods is defined in packages/react-dom/src/__tests__/ReactErrorBoundaries-test.internal.js at line 2578.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free