Home / File/ ErrorBoundary.js — react Source File

ErrorBoundary.js — react Source File

Architecture documentation for ErrorBoundary.js, a javascript file in the react codebase. 19 imports, 1 dependents.

File javascript BabelCompiler Validation 19 imports 1 dependents 2 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  5ae46b4f_0f17_18a6_3def_6dc95832bf63["ErrorBoundary.js"]
  207cc4ae_0d1a_5993_ca8b_89b3990f02d3["UnsupportedBridgeOperationView.js"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 207cc4ae_0d1a_5993_ca8b_89b3990f02d3
  9e4abace_6ec4_8ea5_e882_d4c1c492e09f["UnsupportedBridgeOperationView"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 9e4abace_6ec4_8ea5_e882_d4c1c492e09f
  864e88ce_9228_f8c8_00ad_8f01ef7f49f9["ErrorView.js"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 864e88ce_9228_f8c8_00ad_8f01ef7f49f9
  48e8464a_e8aa_6682_4b13_3ea0de397660["ErrorView"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 48e8464a_e8aa_6682_4b13_3ea0de397660
  3d6199eb_afec_9e8e_1839_d76cc1b13871["SearchingGitHubIssues.js"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 3d6199eb_afec_9e8e_1839_d76cc1b13871
  f9f11d99_717f_ba49_9d3a_2e0753616e06["SearchingGitHubIssues"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> f9f11d99_717f_ba49_9d3a_2e0753616e06
  632dd028_efe6_3846_30ed_2eaf83829007["SuspendingErrorView.js"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 632dd028_efe6_3846_30ed_2eaf83829007
  cbb0930a_877b_edc4_33cb_938567fe8622["SuspendingErrorView"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> cbb0930a_877b_edc4_33cb_938567fe8622
  69908f96_9f7f_457f_47c3_40f834af31dd["TimeoutView.js"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 69908f96_9f7f_457f_47c3_40f834af31dd
  7e046191_3065_2e09_7ae6_dbfb9b4fad13["TimeoutView"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 7e046191_3065_2e09_7ae6_dbfb9b4fad13
  10285ec0_0181_bae4_56b2_04d7b1305779["CaughtErrorView.js"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 10285ec0_0181_bae4_56b2_04d7b1305779
  bb973eb7_720c_76ad_42d5_ac7c062db718["CaughtErrorView"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> bb973eb7_720c_76ad_42d5_ac7c062db718
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  baf70b0e_4867_b3ed_962a_e5c9ae820fef["store"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> baf70b0e_4867_b3ed_962a_e5c9ae820fef
  style 5ae46b4f_0f17_18a6_3def_6dc95832bf63 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

import * as React from 'react';
import {Component, Suspense} from 'react';
import Store from 'react-devtools-shared/src/devtools/store';
import UnsupportedBridgeOperationView from './UnsupportedBridgeOperationView';
import ErrorView from './ErrorView';
import SearchingGitHubIssues from './SearchingGitHubIssues';
import SuspendingErrorView from './SuspendingErrorView';
import TimeoutView from './TimeoutView';
import CaughtErrorView from './CaughtErrorView';
import UnsupportedBridgeOperationError from 'react-devtools-shared/src/UnsupportedBridgeOperationError';
import TimeoutError from 'react-devtools-shared/src/errors/TimeoutError';
import UserError from 'react-devtools-shared/src/errors/UserError';
import UnknownHookError from 'react-devtools-shared/src/errors/UnknownHookError';
import {logEvent} from 'react-devtools-shared/src/Logger';

type Props = {
  children: React$Node,
  canDismiss?: boolean,
  onBeforeDismissCallback?: () => void,
  store?: Store,
};

type State = {
  callStack: string | null,
  canDismiss: boolean,
  componentStack: string | null,
  errorMessage: string | null,
  hasError: boolean,
  isUnsupportedBridgeOperationError: boolean,
  isTimeout: boolean,
  isUserError: boolean,
  isUnknownHookError: boolean,
};

const InitialState: State = {
  callStack: null,
  canDismiss: false,
  componentStack: null,
  errorMessage: null,
  hasError: false,
  isUnsupportedBridgeOperationError: false,
  isTimeout: false,
  isUserError: false,
  isUnknownHookError: false,
};

export default class ErrorBoundary extends Component<Props, State> {
  state: State = InitialState;

  static getDerivedStateFromError(error: any): {
    callStack: string | null,
// ... (180 more lines)

Domain

Subdomains

Classes

Frequently Asked Questions

What does ErrorBoundary.js do?
ErrorBoundary.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ErrorBoundary.js?
ErrorBoundary.js defines 2 function(s): error, type.onBeforeDismissCallback.
What does ErrorBoundary.js depend on?
ErrorBoundary.js imports 19 module(s): CaughtErrorView, CaughtErrorView.js, ErrorView, ErrorView.js, Logger, SearchingGitHubIssues, SearchingGitHubIssues.js, SuspendingErrorView, and 11 more.
What files import ErrorBoundary.js?
ErrorBoundary.js is imported by 1 file(s): index.js.
Where is ErrorBoundary.js in the architecture?
ErrorBoundary.js is located at packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ErrorBoundary.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/devtools/views/ErrorBoundary).

Analyze Your Own Codebase

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

Try Supermodel Free