Home / File/ ErrorView.js — react Source File

ErrorView.js — react Source File

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

File javascript BabelCompiler Validation 6 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  864e88ce_9228_f8c8_00ad_8f01ef7f49f9["ErrorView.js"]
  f9049b08_60f8_abce_a6a6_153f88447124["Button.js"]
  864e88ce_9228_f8c8_00ad_8f01ef7f49f9 --> f9049b08_60f8_abce_a6a6_153f88447124
  f71ee326_17f0_7db4_4178_2763fb1c2ad1["Button"]
  864e88ce_9228_f8c8_00ad_8f01ef7f49f9 --> f71ee326_17f0_7db4_4178_2763fb1c2ad1
  9f39024f_b905_9b0f_2fc7_e24785732638["ButtonIcon.js"]
  864e88ce_9228_f8c8_00ad_8f01ef7f49f9 --> 9f39024f_b905_9b0f_2fc7_e24785732638
  4690d9c0_cb81_9593_7817_f9e61a49f9e7["ButtonIcon"]
  864e88ce_9228_f8c8_00ad_8f01ef7f49f9 --> 4690d9c0_cb81_9593_7817_f9e61a49f9e7
  0472dbde_b52b_1be3_6e72_8d4482dc85ee["shared.css"]
  864e88ce_9228_f8c8_00ad_8f01ef7f49f9 --> 0472dbde_b52b_1be3_6e72_8d4482dc85ee
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  864e88ce_9228_f8c8_00ad_8f01ef7f49f9 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  5ae46b4f_0f17_18a6_3def_6dc95832bf63["ErrorBoundary.js"]
  5ae46b4f_0f17_18a6_3def_6dc95832bf63 --> 864e88ce_9228_f8c8_00ad_8f01ef7f49f9
  style 864e88ce_9228_f8c8_00ad_8f01ef7f49f9 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 Button from '../Button';
import ButtonIcon from '../ButtonIcon';
import styles from './shared.css';

type Props = {
  callStack: string | null,
  children: React$Node,
  componentStack: string | null,
  dismissError: Function | null,
  errorMessage: string | null,
};

export default function ErrorView({
  callStack,
  children,
  componentStack,
  dismissError = null,
  errorMessage,
}: Props): React.Node {
  return (
    <div className={styles.ErrorBoundary}>
      {children}
      <div className={styles.ErrorInfo}>
        <div className={styles.HeaderRow}>
          <div className={styles.ErrorHeader}>
            Uncaught Error: {errorMessage || ''}
          </div>
          {dismissError !== null && (
            <Button className={styles.CloseButton} onClick={dismissError}>
              Dismiss
              <ButtonIcon className={styles.CloseButtonIcon} type="close" />
            </Button>
          )}
        </div>
        {!!callStack && (
          <div className={styles.ErrorStack}>
            The error was thrown {callStack.trim()}
          </div>
        )}
        {!!componentStack && (
          <div className={styles.ErrorStack}>
            The error occurred {componentStack.trim()}
          </div>
        )}
      </div>
    </div>
  );
}

Domain

Subdomains

Functions

Frequently Asked Questions

What does ErrorView.js do?
ErrorView.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 ErrorView.js?
ErrorView.js defines 1 function(s): ErrorView.
What does ErrorView.js depend on?
ErrorView.js imports 6 module(s): Button, Button.js, ButtonIcon, ButtonIcon.js, react, shared.css.
What files import ErrorView.js?
ErrorView.js is imported by 1 file(s): ErrorBoundary.js.
Where is ErrorView.js in the architecture?
ErrorView.js is located at packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ErrorView.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