Home / File/ InspectedElement.js — react Source File

InspectedElement.js — react Source File

Architecture documentation for InspectedElement.js, a javascript file in the react codebase. 27 imports, 2 dependents.

File javascript BabelCompiler Validation 27 imports 2 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  4c0d725a_27bd_a723_3599_a3e75bea5bd3["InspectedElement.js"]
  2d59b0f9_9ad6_da4d_0264_d98f193ab3fd["TreeContext.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 2d59b0f9_9ad6_da4d_0264_d98f193ab3fd
  913bb343_55ea_f1b8_08f5_b75cb0a92b76["context.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  f9049b08_60f8_abce_a6a6_153f88447124["Button.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> f9049b08_60f8_abce_a6a6_153f88447124
  f71ee326_17f0_7db4_4178_2763fb1c2ad1["Button"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> f71ee326_17f0_7db4_4178_2763fb1c2ad1
  9f39024f_b905_9b0f_2fc7_e24785732638["ButtonIcon.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 9f39024f_b905_9b0f_2fc7_e24785732638
  4690d9c0_cb81_9593_7817_f9e61a49f9e7["ButtonIcon"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 4690d9c0_cb81_9593_7817_f9e61a49f9e7
  21af3248_c15c_a61c_1f5b_7409a91b945c["Icon.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 21af3248_c15c_a61c_1f5b_7409a91b945c
  f23861b1_8332_6fa9_2862_ddd6110f3776["Icon"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> f23861b1_8332_6fa9_2862_ddd6110f3776
  61c0d244_ab84_2e1a_7b19_996aebeb6c63["Toggle.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 61c0d244_ab84_2e1a_7b19_996aebeb6c63
  ad68b45d_879b_b053_fa18_da49ca05b77a["Toggle"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> ad68b45d_879b_b053_fa18_da49ca05b77a
  d09ae4bb_9ed0_3257_c11b_1c199408288d["InspectedElementView.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> d09ae4bb_9ed0_3257_c11b_1c199408288d
  7eb35975_2790_0625_6d8b_13822a157d5c["InspectedElementView"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 7eb35975_2790_0625_6d8b_13822a157d5c
  73a58bda_a3e0_b7ab_6561_84167121e1ae["InspectedElementContext.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 73a58bda_a3e0_b7ab_6561_84167121e1ae
  0de29888_ca49_eb3c_33f7_ab4fff46de0b["utils.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 0de29888_ca49_eb3c_33f7_ab4fff46de0b
  style 4c0d725a_27bd_a723_3599_a3e75bea5bd3 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 {SourceMappedLocation} from 'react-devtools-shared/src/symbolicateSource';

import * as React from 'react';
import {useCallback, useContext, useSyncExternalStore} from 'react';
import {TreeStateContext} from './TreeContext';
import {BridgeContext, StoreContext, OptionsContext} from '../context';
import Button from '../Button';
import ButtonIcon from '../ButtonIcon';
import Icon from '../Icon';
import Toggle from '../Toggle';
import {
  ElementTypeSuspense,
  ElementTypeRoot,
} from 'react-devtools-shared/src/frontend/types';
import InspectedElementView from './InspectedElementView';
import {InspectedElementContext} from './InspectedElementContext';
import {getAlwaysOpenInEditor} from '../../../utils';
import {LOCAL_STORAGE_ALWAYS_OPEN_IN_EDITOR} from '../../../constants';
import FetchFileWithCachingContext from './FetchFileWithCachingContext';
import {symbolicateSourceWithCache} from 'react-devtools-shared/src/symbolicateSource';
import OpenInEditorButton from './OpenInEditorButton';
import InspectedElementViewSourceButton from './InspectedElementViewSourceButton';
import useEditorURL from '../useEditorURL';

import styles from './InspectedElement.css';
import Tooltip from './reach-ui/tooltip';

export type Props = {
  actionButtons?: React.Node,
  /** fallback to show when no element is inspected */
  fallbackEmpty: React.Node,
};

// TODO Make edits and deletes also use transition API!

const noSourcePromise = Promise.resolve(null);

export default function InspectedElementWrapper({
  actionButtons,
  fallbackEmpty,
}: Props): React.Node {
  const {inspectedElementID} = useContext(TreeStateContext);
  const bridge = useContext(BridgeContext);
  const store = useContext(StoreContext);
  const {
    hideToggleErrorAction,
    hideToggleSuspenseAction,
    hideLogAction,
    hideViewSourceAction,
  } = useContext(OptionsContext);

// ... (282 more lines)

Domain

Subdomains

Frequently Asked Questions

What does InspectedElement.js do?
InspectedElement.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 InspectedElement.js?
InspectedElement.js defines 1 function(s): InspectedElementWrapper.
What does InspectedElement.js depend on?
InspectedElement.js imports 27 module(s): Button, Button.js, ButtonIcon, ButtonIcon.js, FetchFileWithCachingContext.js, Icon, Icon.js, InspectedElement.css, and 19 more.
What files import InspectedElement.js?
InspectedElement.js is imported by 2 file(s): Components.js, SuspenseTab.js.
Where is InspectedElement.js in the architecture?
InspectedElement.js is located at packages/react-devtools-shared/src/devtools/views/Components/InspectedElement.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/devtools/views/Components).

Analyze Your Own Codebase

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

Try Supermodel Free