Home / File/ Contexts.js — react Source File

Contexts.js — react Source File

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

File javascript BabelCompiler 3 imports 1 dependents 1 classes

Entity Profile

Dependency Diagram

graph LR
  94f0305b_87cd_72d5_489c_d2ce0ce0ccea["Contexts.js"]
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  94f0305b_87cd_72d5_489c_d2ce0ce0ccea --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  4962a421_6f44_376a_ec35_6032e4845540["prop-types"]
  94f0305b_87cd_72d5_489c_d2ce0ce0ccea --> 4962a421_6f44_376a_ec35_6032e4845540
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  94f0305b_87cd_72d5_489c_d2ce0ce0ccea --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  ee521c92_6aea_ed48_b3b2_59ca21d468e3["InspectableElements.js"]
  ee521c92_6aea_ed48_b3b2_59ca21d468e3 --> 94f0305b_87cd_72d5_489c_d2ce0ce0ccea
  style 94f0305b_87cd_72d5_489c_d2ce0ce0ccea 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 {createContext, Component, useContext, useState} from 'react';
import PropTypes from 'prop-types';

import type {ReactContext} from 'shared/ReactTypes';

function someNamedFunction() {}

function formatContextForDisplay(name: string, value: any | string) {
  return (
    <li>
      {name}: <pre>{JSON.stringify(value, null, 2)}</pre>
    </li>
  );
}

const contextData = {
  array: ['first', 'second', 'third'],
  bool: true,
  func: someNamedFunction,
  number: 123,
  object: {outer: {inner: {} as {...}}},
  string: 'abc',
  symbol: Symbol.for('symbol'),
  null: null,
  undefined: undefined,
};

class LegacyContextProvider extends Component<any> {
  static childContextTypes: {
    array: any,
    bool: any,
    func: any,
    null: any,
    number: any,
    object: any,
    string: any,
    symbol: any,
    undefined: any,
  } = {
    array: PropTypes.array,
    bool: PropTypes.bool,
    func: PropTypes.func,
    number: PropTypes.number,
    object: PropTypes.object,
    string: PropTypes.string,
    symbol: PropTypes.symbol,
    null: PropTypes.any,
    undefined: PropTypes.any,
  };

// ... (311 more lines)

Domain

Dependencies

  • ReactTypes
  • prop-types
  • react

Frequently Asked Questions

What does Contexts.js do?
Contexts.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does Contexts.js depend on?
Contexts.js imports 3 module(s): ReactTypes, prop-types, react.
What files import Contexts.js?
Contexts.js is imported by 1 file(s): InspectableElements.js.
Where is Contexts.js in the architecture?
Contexts.js is located at packages/react-devtools-shell/src/app/InspectableElements/Contexts.js (domain: BabelCompiler, directory: packages/react-devtools-shell/src/app/InspectableElements).

Analyze Your Own Codebase

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

Try Supermodel Free