Home / File/ context.js — react Source File

context.js — react Source File

Architecture documentation for context.js, a javascript file in the react codebase. 5 imports, 47 dependents.

File javascript BabelCompiler 5 imports 47 dependents

Entity Profile

Dependency Diagram

graph LR
  913bb343_55ea_f1b8_08f5_b75cb0a92b76["context.js"]
  bba85af0_a356_d0c5_4d12_914508b89593["store.js"]
  913bb343_55ea_f1b8_08f5_b75cb0a92b76 --> bba85af0_a356_d0c5_4d12_914508b89593
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  913bb343_55ea_f1b8_08f5_b75cb0a92b76 --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  913bb343_55ea_f1b8_08f5_b75cb0a92b76 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  ce034302_61e9_5cdc_95e6_1e120df583e4["DevTools"]
  913bb343_55ea_f1b8_08f5_b75cb0a92b76 --> ce034302_61e9_5cdc_95e6_1e120df583e4
  4077b620_5c59_61c2_0910_273f565da757["bridge"]
  913bb343_55ea_f1b8_08f5_b75cb0a92b76 --> 4077b620_5c59_61c2_0910_273f565da757
  3bbe1444_b210_8ba4_4493_8fd51690fd1d["ActivitySlice.js"]
  3bbe1444_b210_8ba4_4493_8fd51690fd1d --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  9930e8cf_03b4_86c0_be04_47b410246b71["Element.js"]
  9930e8cf_03b4_86c0_be04_47b410246b71 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  c4e436c2_f97f_ce14_4047_a3741d53d2b6["InspectHostNodesToggle.js"]
  c4e436c2_f97f_ce14_4047_a3741d53d2b6 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  4c0d725a_27bd_a723_3599_a3e75bea5bd3["InspectedElement.js"]
  4c0d725a_27bd_a723_3599_a3e75bea5bd3 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  73a58bda_a3e0_b7ab_6561_84167121e1ae["InspectedElementContext.js"]
  73a58bda_a3e0_b7ab_6561_84167121e1ae --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  5a9f89d7_52b7_04f5_ab3d_8ec03c9054e3["InspectedElementHooksTree.js"]
  5a9f89d7_52b7_04f5_ab3d_8ec03c9054e3 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  816abfef_4d5d_bc7e_fc00_1acadf628d28["InspectedElementPropsTree.js"]
  816abfef_4d5d_bc7e_fc00_1acadf628d28 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  d09ae4bb_9ed0_3257_c11b_1c199408288d["InspectedElementView.js"]
  d09ae4bb_9ed0_3257_c11b_1c199408288d --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  276bc34e_3008_101e_3cd7_cc895fcd3848["KeyValue.js"]
  276bc34e_3008_101e_3cd7_cc895fcd3848 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  style 913bb343_55ea_f1b8_08f5_b75cb0a92b76 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 {createContext} from 'react';
import Store from '../store';

import type {ViewAttributeSource} from 'react-devtools-shared/src/devtools/views/DevTools';
import type {FrontendBridge} from 'react-devtools-shared/src/bridge';

export const BridgeContext: ReactContext<FrontendBridge> =
  createContext<FrontendBridge>(((null: any): FrontendBridge));
BridgeContext.displayName = 'BridgeContext';

export const StoreContext: ReactContext<Store> = createContext<Store>(
  ((null: any): Store),
);
StoreContext.displayName = 'StoreContext';

export type ContextMenuContextType = {
  isEnabledForInspectedElement: boolean,
  viewAttributeSourceFunction: ViewAttributeSource | null,
};

export const ContextMenuContext: ReactContext<ContextMenuContextType> =
  createContext<ContextMenuContextType>({
    isEnabledForInspectedElement: false,
    viewAttributeSourceFunction: null,
  });
ContextMenuContext.displayName = 'ContextMenuContext';

export type OptionsContextType = {
  readOnly: boolean,
  hideSettings: boolean,
  hideToggleErrorAction: boolean,
  hideToggleSuspenseAction: boolean,
  hideLogAction: boolean,
  hideViewSourceAction: boolean,
};

export const OptionsContext: ReactContext<OptionsContextType> =
  createContext<OptionsContextType>({
    readOnly: false,
    hideSettings: false,
    hideToggleErrorAction: false,
    hideToggleSuspenseAction: false,
    hideLogAction: false,
    hideViewSourceAction: false,
  });

Domain

Dependencies

Imported By

Frequently Asked Questions

What does context.js do?
context.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does context.js depend on?
context.js imports 5 module(s): DevTools, ReactTypes, bridge, react, store.js.
What files import context.js?
context.js is imported by 47 file(s): ActivityList.js, ActivitySlice.js, ClearProfilingDataButton.js, CommitFlamegraph.js, CommitRanked.js, ComponentsSettings.js, DevTools.js, Element.js, and 39 more.
Where is context.js in the architecture?
context.js is located at packages/react-devtools-shared/src/devtools/views/context.js (domain: BabelCompiler, 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