Home / File/ ReactNativeViewConfigRegistry.js — react Source File

ReactNativeViewConfigRegistry.js — react Source File

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

Entity Profile

Dependency Diagram

graph LR
  63fa019a_25b8_4530_f34d_77b8d5274ee1["ReactNativeViewConfigRegistry.js"]
  af2a37ce_54b3_b243_ae04_c7ff8eb2832c["./ReactNativeTypes"]
  63fa019a_25b8_4530_f34d_77b8d5274ee1 --> af2a37ce_54b3_b243_ae04_c7ff8eb2832c
  7b0f5d46_efcb_4a2d_89c1_7cee4a0f9bc8["invariant"]
  63fa019a_25b8_4530_f34d_77b8d5274ee1 --> 7b0f5d46_efcb_4a2d_89c1_7cee4a0f9bc8
  style 63fa019a_25b8_4530_f34d_77b8d5274ee1 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.
 *
 * @noformat
 * @nolint
 * @flow strict-local
 */

'use strict';

import {type ViewConfig} from './ReactNativeTypes';
import invariant from 'invariant';

// Event configs
export const customBubblingEventTypes: {
  [eventName: string]: $ReadOnly<{
    phasedRegistrationNames: $ReadOnly<{
      captured: string,
      bubbled: string,
      skipBubbling?: ?boolean,
    }>,
  }>,
} = {};
export const customDirectEventTypes: {
  [eventName: string]: $ReadOnly<{
    registrationName: string,
  }>,
} = {};

const viewConfigCallbacks = new Map<string, ?() => ViewConfig>();
const viewConfigs = new Map<string, ViewConfig>();

function processEventTypes(viewConfig: ViewConfig): void {
  const {bubblingEventTypes, directEventTypes} = viewConfig;

  if (__DEV__) {
    if (bubblingEventTypes != null && directEventTypes != null) {
      for (const topLevelType in directEventTypes) {
        invariant(
          bubblingEventTypes[topLevelType] == null,
          'Event cannot be both direct and bubbling: %s',
          topLevelType,
        );
      }
    }
  }

  if (bubblingEventTypes != null) {
    for (const topLevelType in bubblingEventTypes) {
      if (customBubblingEventTypes[topLevelType] == null) {
        customBubblingEventTypes[topLevelType] =
          bubblingEventTypes[topLevelType];
      }
    }
  }

  if (directEventTypes != null) {
// ... (65 more lines)

Domain

Dependencies

  • ./ReactNativeTypes
  • invariant

Frequently Asked Questions

What does ReactNativeViewConfigRegistry.js do?
ReactNativeViewConfigRegistry.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain.
What does ReactNativeViewConfigRegistry.js depend on?
ReactNativeViewConfigRegistry.js imports 2 module(s): ./ReactNativeTypes, invariant.
Where is ReactNativeViewConfigRegistry.js in the architecture?
ReactNativeViewConfigRegistry.js is located at scripts/rollup/shims/react-native/ReactNativeViewConfigRegistry.js (domain: BabelCompiler, directory: scripts/rollup/shims/react-native).

Analyze Your Own Codebase

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

Try Supermodel Free