Home / File/ ReactChildren.js — react Source File

ReactChildren.js — react Source File

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

File javascript BabelCompiler 9 imports 5 dependents

Entity Profile

Dependency Diagram

graph LR
  511230ce_1ad3_362f_884f_97bae6263b2d["ReactChildren.js"]
  1bf5591f_27a1_c79f_853a_6242549e0e07["ReactJSXElement.js"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> 1bf5591f_27a1_c79f_853a_6242549e0e07
  fb777ded_67ec_6e96_c038_9aa7ec4ae90c["isValidElement"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> fb777ded_67ec_6e96_c038_9aa7ec4ae90c
  b08010e3_571c_f8e9_f77b_875161a3dce7["cloneAndReplaceKey"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> b08010e3_571c_f8e9_f77b_875161a3dce7
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  af78c51d_c7cb_3bf4_550f_f3fcc48f4f34["isArray"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> af78c51d_c7cb_3bf4_550f_f3fcc48f4f34
  4321c04c_6e7b_409b_4c59_c09fbf7074a8["noop"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> 4321c04c_6e7b_409b_4c59_c09fbf7074a8
  e1e1de60_2be4_0643_45fb_e2c306735427["ReactSymbols"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> e1e1de60_2be4_0643_45fb_e2c306735427
  8344de1b_978c_be0f_eebd_38ccc4962a93["ReactFeatureFlags"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> 8344de1b_978c_be0f_eebd_38ccc4962a93
  0ae63ebd_b26a_05c8_1c6d_275a5f6b76c7["CheckStringCoercion"]
  511230ce_1ad3_362f_884f_97bae6263b2d --> 0ae63ebd_b26a_05c8_1c6d_275a5f6b76c7
  ffdf54f0_7e34_f1e9_1504_9dbadb0fbac5["ReactClient.js"]
  ffdf54f0_7e34_f1e9_1504_9dbadb0fbac5 --> 511230ce_1ad3_362f_884f_97bae6263b2d
  a893f937_cfbc_33f8_94ec_23cb5000691e["ReactServer.experimental.development.js"]
  a893f937_cfbc_33f8_94ec_23cb5000691e --> 511230ce_1ad3_362f_884f_97bae6263b2d
  8510e4c8_924c_b1b8_d0a0_11cb99b570c0["ReactServer.experimental.js"]
  8510e4c8_924c_b1b8_d0a0_11cb99b570c0 --> 511230ce_1ad3_362f_884f_97bae6263b2d
  6274036e_add3_9702_84fb_266b97b7660a["ReactServer.fb.js"]
  6274036e_add3_9702_84fb_266b97b7660a --> 511230ce_1ad3_362f_884f_97bae6263b2d
  a86f40a1_cfab_7bca_7368_f11f9ee52c80["ReactServer.js"]
  a86f40a1_cfab_7bca_7368_f11f9ee52c80 --> 511230ce_1ad3_362f_884f_97bae6263b2d
  style 511230ce_1ad3_362f_884f_97bae6263b2d 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 {
  ReactNodeList,
  Thenable,
  PendingThenable,
  FulfilledThenable,
  RejectedThenable,
} from 'shared/ReactTypes';

import isArray from 'shared/isArray';
import noop from 'shared/noop';
import {
  getIteratorFn,
  REACT_ELEMENT_TYPE,
  REACT_LAZY_TYPE,
  REACT_PORTAL_TYPE,
  REACT_OPTIMISTIC_KEY,
} from 'shared/ReactSymbols';
import {enableOptimisticKey} from 'shared/ReactFeatureFlags';
import {checkKeyStringCoercion} from 'shared/CheckStringCoercion';

import {isValidElement, cloneAndReplaceKey} from './jsx/ReactJSXElement';

const SEPARATOR = '.';
const SUBSEPARATOR = ':';

/**
 * Escape and wrap key so it is safe to use as a reactid
 *
 * @param {string} key to be escaped.
 * @return {string} the escaped key.
 */
function escape(key: string): string {
  const escapeRegex = /[=:]/g;
  const escaperLookup = {
    '=': '=0',
    ':': '=2',
  };
  const escapedString = key.replace(escapeRegex, function (match) {
    // $FlowFixMe[invalid-computed-prop]
    return escaperLookup[match];
  });

  return '$' + escapedString;
}

/**
 * TODO: Test that a single child and an array with one item have the same key
 * pattern.
 */

let didWarnAboutMaps = false;
// ... (412 more lines)

Domain

Dependencies

Frequently Asked Questions

What does ReactChildren.js do?
ReactChildren.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does ReactChildren.js depend on?
ReactChildren.js imports 9 module(s): CheckStringCoercion, ReactFeatureFlags, ReactJSXElement.js, ReactSymbols, ReactTypes, cloneAndReplaceKey, isArray, isValidElement, and 1 more.
What files import ReactChildren.js?
ReactChildren.js is imported by 5 file(s): ReactClient.js, ReactServer.experimental.development.js, ReactServer.experimental.js, ReactServer.fb.js, ReactServer.js.
Where is ReactChildren.js in the architecture?
ReactChildren.js is located at packages/react/src/ReactChildren.js (domain: BabelCompiler, directory: packages/react/src).

Analyze Your Own Codebase

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

Try Supermodel Free