Home / File/ SettingsContext.js — react Source File

SettingsContext.js — react Source File

Architecture documentation for SettingsContext.js, a javascript file in the react codebase. 8 imports, 10 dependents.

File javascript BabelCompiler 8 imports 10 dependents

Entity Profile

Dependency Diagram

graph LR
  5996f1e4_af81_a51b_84bc_175bfba4f818["SettingsContext.js"]
  315baf50_1028_51ca_a9c1_679c6a17ed98["hooks.js"]
  5996f1e4_af81_a51b_84bc_175bfba4f818 --> 315baf50_1028_51ca_a9c1_679c6a17ed98
  913bb343_55ea_f1b8_08f5_b75cb0a92b76["context.js"]
  5996f1e4_af81_a51b_84bc_175bfba4f818 --> 913bb343_55ea_f1b8_08f5_b75cb0a92b76
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  5996f1e4_af81_a51b_84bc_175bfba4f818 --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  5996f1e4_af81_a51b_84bc_175bfba4f818 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  55d27179_f566_db64_927b_e95655abee00["constants"]
  5996f1e4_af81_a51b_84bc_175bfba4f818 --> 55d27179_f566_db64_927b_e95655abee00
  5e586213_f9d4_ea00_b68f_3bb5d6133eb4["constants"]
  5996f1e4_af81_a51b_84bc_175bfba4f818 --> 5e586213_f9d4_ea00_b68f_3bb5d6133eb4
  2b832bf7_5b5b_7f08_2faa_1e7c8d8acc6d["Logger"]
  5996f1e4_af81_a51b_84bc_175bfba4f818 --> 2b832bf7_5b5b_7f08_2faa_1e7c8d8acc6d
  aec7978f_0a19_ba93_de9e_ac8cf5ddc74b["types"]
  5996f1e4_af81_a51b_84bc_175bfba4f818 --> aec7978f_0a19_ba93_de9e_ac8cf5ddc74b
  73a58bda_a3e0_b7ab_6561_84167121e1ae["InspectedElementContext.js"]
  73a58bda_a3e0_b7ab_6561_84167121e1ae --> 5996f1e4_af81_a51b_84bc_175bfba4f818
  80ad5569_a221_98e5_daec_ede1bea33ee0["Tree.js"]
  80ad5569_a221_98e5_daec_ede1bea33ee0 --> 5996f1e4_af81_a51b_84bc_175bfba4f818
  e2c52a93_982e_407f_9fee_e89aa134ae9d["DevTools.js"]
  e2c52a93_982e_407f_9fee_e89aa134ae9d --> 5996f1e4_af81_a51b_84bc_175bfba4f818
  54e7a598_e83a_4b14_3104_1fa62a034c31["CommitFlamegraph.js"]
  54e7a598_e83a_4b14_3104_1fa62a034c31 --> 5996f1e4_af81_a51b_84bc_175bfba4f818
  6d32cfc6_78ff_92b2_0a33_092cde10d395["CommitFlamegraphListItem.js"]
  6d32cfc6_78ff_92b2_0a33_092cde10d395 --> 5996f1e4_af81_a51b_84bc_175bfba4f818
  0ad6c6d5_5d6d_2d8a_d957_e1433af66ea0["CommitRanked.js"]
  0ad6c6d5_5d6d_2d8a_d957_e1433af66ea0 --> 5996f1e4_af81_a51b_84bc_175bfba4f818
  style 5996f1e4_af81_a51b_84bc_175bfba4f818 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,
  useContext,
  useEffect,
  useLayoutEffect,
  useMemo,
} from 'react';
import {
  LOCAL_STORAGE_BROWSER_THEME,
  LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY,
  LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY,
} from 'react-devtools-shared/src/constants';
import {
  COMFORTABLE_LINE_HEIGHT,
  COMPACT_LINE_HEIGHT,
} from 'react-devtools-shared/src/devtools/constants';
import {useLocalStorage} from '../hooks';
import {BridgeContext} from '../context';
import {logEvent} from 'react-devtools-shared/src/Logger';

import type {BrowserTheme} from 'react-devtools-shared/src/frontend/types';

export type DisplayDensity = 'comfortable' | 'compact';
export type Theme = 'auto' | 'light' | 'dark';

type Context = {
  displayDensity: DisplayDensity,
  setDisplayDensity(value: DisplayDensity): void,

  // Derived from display density.
  // Specified as a separate prop so it can trigger a re-render of FixedSizeList.
  lineHeight: number,

  parseHookNames: boolean,
  setParseHookNames: (value: boolean) => void,

  theme: Theme,
  setTheme(value: Theme): void,

  browserTheme: Theme,

  traceUpdatesEnabled: boolean,
  setTraceUpdatesEnabled: (value: boolean) => void,
};

const SettingsContext: ReactContext<Context> = createContext<Context>(
  ((null: any): Context),
);
// ... (184 more lines)

Domain

Dependencies

Frequently Asked Questions

What does SettingsContext.js do?
SettingsContext.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does SettingsContext.js depend on?
SettingsContext.js imports 8 module(s): Logger, ReactTypes, constants, constants, context.js, hooks.js, react, types.
What files import SettingsContext.js?
SettingsContext.js is imported by 10 file(s): CommitFlamegraph.js, CommitFlamegraphListItem.js, CommitRanked.js, CommitRankedListItem.js, ComponentsSettings.js, DevTools.js, GeneralSettings.js, InspectedElementContext.js, and 2 more.
Where is SettingsContext.js in the architecture?
SettingsContext.js is located at packages/react-devtools-shared/src/devtools/views/Settings/SettingsContext.js (domain: BabelCompiler, directory: packages/react-devtools-shared/src/devtools/views/Settings).

Analyze Your Own Codebase

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

Try Supermodel Free