Home / File/ ReactNativePublicCompat.js — react Source File

ReactNativePublicCompat.js — react Source File

Architecture documentation for ReactNativePublicCompat.js, a javascript file in the react codebase. 7 imports, 4 dependents.

File javascript BabelCompiler Validation 7 imports 4 dependents 5 functions

Entity Profile

Dependency Diagram

graph LR
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02["ReactNativePublicCompat.js"]
  24686b4c_3c4b_6fa0_b125_37d3286a1ff4["ReactNativeTypes.js"]
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02 --> 24686b4c_3c4b_6fa0_b125_37d3286a1ff4
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  94a68304_3047_524d_e604_af34f5a80eaf["ReactNativePrivateInterface"]
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02 --> 94a68304_3047_524d_e604_af34f5a80eaf
  ddecbf3f_f337_559f_a83b_7d088cc54c15["ReactFiberReconciler"]
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02 --> ddecbf3f_f337_559f_a83b_7d088cc54c15
  7f19218b_4899_62d7_ffe7_3eef935f36ce["ReactFiberTreeReflection"]
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02 --> 7f19218b_4899_62d7_ffe7_3eef935f36ce
  3c38cd62_f628_0c7b_096c_856305caeada["getComponentNameFromType"]
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02 --> 3c38cd62_f628_0c7b_096c_856305caeada
  9a7dedff_ebb2_a1a9_a4c3_be4ea69f001e["ReactCurrentFiber"]
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02 --> 9a7dedff_ebb2_a1a9_a4c3_be4ea69f001e
  c3cad15d_c9da_151e_b05e_05fb765a0a1d["ReactFabric.js"]
  c3cad15d_c9da_151e_b05e_05fb765a0a1d --> c8cde18a_a62b_2ad5_9e88_a5d655a07f02
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8["ReactNativeFiberInspector.js"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> c8cde18a_a62b_2ad5_9e88_a5d655a07f02
  05ccf719_9df5_4e38_01ba_8eadf09bacc1["ReactNativeRenderer.js"]
  05ccf719_9df5_4e38_01ba_8eadf09bacc1 --> c8cde18a_a62b_2ad5_9e88_a5d655a07f02
  92c9535e_3e9c_6383_e815_e686948bdbe0["getNodeFromPublicInstance.js"]
  92c9535e_3e9c_6383_e815_e686948bdbe0 --> c8cde18a_a62b_2ad5_9e88_a5d655a07f02
  style c8cde18a_a62b_2ad5_9e88_a5d655a07f02 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 {Node} from './ReactNativeTypes';
import type {ElementRef, ElementType} from 'react';
import type {PublicInstance} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';

// Modules provided by RN:
import {
  UIManager,
  legacySendAccessibilityEvent,
  getNodeFromPublicInstance,
  getNativeTagFromPublicInstance,
  getInternalInstanceHandleFromPublicInstance,
} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';

import {
  findHostInstance,
  findHostInstanceWithWarning,
} from 'react-reconciler/src/ReactFiberReconciler';
import {doesFiberContain} from 'react-reconciler/src/ReactFiberTreeReflection';
import getComponentNameFromType from 'shared/getComponentNameFromType';
import {
  current as currentOwner,
  isRendering,
} from 'react-reconciler/src/ReactCurrentFiber';

export function findHostInstance_DEPRECATED<TElementType: ElementType>(
  componentOrHandle: ?(ElementRef<TElementType> | number),
): ?PublicInstance {
  if (__DEV__) {
    const owner = currentOwner;
    if (owner !== null && isRendering && owner.stateNode !== null) {
      if (!owner.stateNode._warnedAboutRefsInRender) {
        console.error(
          '%s is accessing findNodeHandle inside its render(). ' +
            'render() should be a pure function of props and state. It should ' +
            'never access something that requires stale data from the previous ' +
            'render, such as refs. Move this logic to componentDidMount and ' +
            'componentDidUpdate instead.',
          getComponentNameFromType(owner.type) || 'A component',
        );
      }

      owner.stateNode._warnedAboutRefsInRender = true;
    }
  }

  if (componentOrHandle == null) {
    return null;
  }

  // For compatibility with Fabric instances
  if (
// ... (213 more lines)

Domain

Subdomains

Dependencies

  • ReactCurrentFiber
  • ReactFiberReconciler
  • ReactFiberTreeReflection
  • ReactNativePrivateInterface
  • ReactNativeTypes.js
  • getComponentNameFromType
  • react

Frequently Asked Questions

What does ReactNativePublicCompat.js do?
ReactNativePublicCompat.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ReactNativePublicCompat.js?
ReactNativePublicCompat.js defines 5 function(s): dispatchCommand, findNodeHandle, getNodeFromInternalInstanceHandle, isChildPublicInstance, sendAccessibilityEvent.
What does ReactNativePublicCompat.js depend on?
ReactNativePublicCompat.js imports 7 module(s): ReactCurrentFiber, ReactFiberReconciler, ReactFiberTreeReflection, ReactNativePrivateInterface, ReactNativeTypes.js, getComponentNameFromType, react.
What files import ReactNativePublicCompat.js?
ReactNativePublicCompat.js is imported by 4 file(s): ReactFabric.js, ReactNativeFiberInspector.js, ReactNativeRenderer.js, getNodeFromPublicInstance.js.
Where is ReactNativePublicCompat.js in the architecture?
ReactNativePublicCompat.js is located at packages/react-native-renderer/src/ReactNativePublicCompat.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-native-renderer/src).

Analyze Your Own Codebase

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

Try Supermodel Free