Home / File/ ModalDialog.js — react Source File

ModalDialog.js — react Source File

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

File javascript BabelCompiler Validation 6 imports 7 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  899cf357_78bc_8627_bd54_2c00e2c9fde2["ModalDialog.js"]
  f9049b08_60f8_abce_a6a6_153f88447124["Button.js"]
  899cf357_78bc_8627_bd54_2c00e2c9fde2 --> f9049b08_60f8_abce_a6a6_153f88447124
  f71ee326_17f0_7db4_4178_2763fb1c2ad1["Button"]
  899cf357_78bc_8627_bd54_2c00e2c9fde2 --> f71ee326_17f0_7db4_4178_2763fb1c2ad1
  315baf50_1028_51ca_a9c1_679c6a17ed98["hooks.js"]
  899cf357_78bc_8627_bd54_2c00e2c9fde2 --> 315baf50_1028_51ca_a9c1_679c6a17ed98
  29dbcbd3_a742_50a4_e915_fe1e6170ab0b["ModalDialog.css"]
  899cf357_78bc_8627_bd54_2c00e2c9fde2 --> 29dbcbd3_a742_50a4_e915_fe1e6170ab0b
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  899cf357_78bc_8627_bd54_2c00e2c9fde2 --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  899cf357_78bc_8627_bd54_2c00e2c9fde2 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  a2fac529_5caa_fd15_61d0_e5b11d75bdd2["Components.js"]
  a2fac529_5caa_fd15_61d0_e5b11d75bdd2 --> 899cf357_78bc_8627_bd54_2c00e2c9fde2
  e2c52a93_982e_407f_9fee_e89aa134ae9d["DevTools.js"]
  e2c52a93_982e_407f_9fee_e89aa134ae9d --> 899cf357_78bc_8627_bd54_2c00e2c9fde2
  2e59ff66_9c56_6e37_8843_8e474e6b0d70["Profiler.js"]
  2e59ff66_9c56_6e37_8843_8e474e6b0d70 --> 899cf357_78bc_8627_bd54_2c00e2c9fde2
  b191034a_a94e_84c8_d9bb_fcdcfa226cc1["ProfilingImportExportButtons.js"]
  b191034a_a94e_84c8_d9bb_fcdcfa226cc1 --> 899cf357_78bc_8627_bd54_2c00e2c9fde2
  18ec4422_530f_c966_12b1_68446a69be22["UnsupportedBridgeProtocolDialog.js"]
  18ec4422_530f_c966_12b1_68446a69be22 --> 899cf357_78bc_8627_bd54_2c00e2c9fde2
  2b861b3e_4cb9_174c_13d4_aec0fc37d1b1["UnsupportedVersionDialog.js"]
  2b861b3e_4cb9_174c_13d4_aec0fc37d1b1 --> 899cf357_78bc_8627_bd54_2c00e2c9fde2
  87fd0981_62e7_8a4e_e24c_67f948fec1d9["WarnIfLegacyBackendDetected.js"]
  87fd0981_62e7_8a4e_e24c_67f948fec1d9 --> 899cf357_78bc_8627_bd54_2c00e2c9fde2
  style 899cf357_78bc_8627_bd54_2c00e2c9fde2 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 type {ReactContext} from 'shared/ReactTypes';
import * as React from 'react';
import {
  createContext,
  useCallback,
  useContext,
  useMemo,
  useReducer,
  useRef,
} from 'react';
import Button from './Button';
import {useModalDismissSignal} from './hooks';

import styles from './ModalDialog.css';

type ID = any;

type DIALOG_ACTION_HIDE = {
  type: 'HIDE',
  id: ID,
};
type DIALOG_ACTION_SHOW = {
  type: 'SHOW',
  canBeDismissed?: boolean,
  content: React$Node,
  id: ID,
  title?: React$Node | null,
};

type Action = DIALOG_ACTION_HIDE | DIALOG_ACTION_SHOW;

type Dispatch = (action: Action) => void;

type Dialog = {
  canBeDismissed: boolean,
  content: React$Node | null,
  id: ID,
  title: React$Node | null,
};

type State = {
  dialogs: Array<Dialog>,
};

type ModalDialogContextType = {
  ...State,
  dispatch: Dispatch,
};

const ModalDialogContext: ReactContext<ModalDialogContextType> =
  createContext<ModalDialogContextType>(((null: any): ModalDialogContextType));
// ... (127 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does ModalDialog.js do?
ModalDialog.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 ModalDialog.js?
ModalDialog.js defines 2 function(s): Dispatch, handleDialogClick.
What does ModalDialog.js depend on?
ModalDialog.js imports 6 module(s): Button, Button.js, ModalDialog.css, ReactTypes, hooks.js, react.
What files import ModalDialog.js?
ModalDialog.js is imported by 7 file(s): Components.js, DevTools.js, Profiler.js, ProfilingImportExportButtons.js, UnsupportedBridgeProtocolDialog.js, UnsupportedVersionDialog.js, WarnIfLegacyBackendDetected.js.
Where is ModalDialog.js in the architecture?
ModalDialog.js is located at packages/react-devtools-shared/src/devtools/views/ModalDialog.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/devtools/views).

Analyze Your Own Codebase

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

Try Supermodel Free