Home / File/ ReactNativeFiberInspector.js — react Source File

ReactNativeFiberInspector.js — react Source File

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

File javascript BabelCompiler Validation 11 imports 2 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8["ReactNativeFiberInspector.js"]
  24686b4c_3c4b_6fa0_b125_37d3286a1ff4["ReactNativeTypes.js"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> 24686b4c_3c4b_6fa0_b125_37d3286a1ff4
  6558eedc_539e_2a0a_77c0_574f399b3f4a["ReactNativeComponentTree.js"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> 6558eedc_539e_2a0a_77c0_574f399b3f4a
  c8cde18a_a62b_2ad5_9e88_a5d655a07f02["ReactNativePublicCompat.js"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> c8cde18a_a62b_2ad5_9e88_a5d655a07f02
  6e94430d_bdbd_d18c_30eb_ae6088e8d367["getNodeFromInternalInstanceHandle"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> 6e94430d_bdbd_d18c_30eb_ae6088e8d367
  a3dc8ce3_5fa4_00f6_cc2f_856df9b1b09d["findNodeHandle"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> a3dc8ce3_5fa4_00f6_cc2f_856df9b1b09d
  42892443_e223_3da0_aeb9_e1b32a408fb0["ReactInternalTypes"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> 42892443_e223_3da0_aeb9_e1b32a408fb0
  7f19218b_4899_62d7_ffe7_3eef935f36ce["ReactFiberTreeReflection"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> 7f19218b_4899_62d7_ffe7_3eef935f36ce
  3c38cd62_f628_0c7b_096c_856305caeada["getComponentNameFromType"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> 3c38cd62_f628_0c7b_096c_856305caeada
  f8f61929_42ba_4030_bc4f_a1c5484f5f32["ReactWorkTags"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> f8f61929_42ba_4030_bc4f_a1c5484f5f32
  94a68304_3047_524d_e604_af34f5a80eaf["ReactNativePrivateInterface"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> 94a68304_3047_524d_e604_af34f5a80eaf
  030c9bfc_2ede_caa1_943d_51accafe0f56["ReactFiberComponentStack"]
  b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 --> 030c9bfc_2ede_caa1_943d_51accafe0f56
  948a0d34_693c_c158_f23e_d41306507c72["ReactFiberConfigFabric.js"]
  948a0d34_693c_c158_f23e_d41306507c72 --> b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8
  3d20f780_732d_dfbf_ddf9_cb13ba9949a1["ReactFiberConfigNative.js"]
  3d20f780_732d_dfbf_ddf9_cb13ba9949a1 --> b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8
  style b96e6f5e_b1ed_ae54_d2fa_ae1632468aa8 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 {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {TouchedViewDataAtPoint, InspectorData} from './ReactNativeTypes';

import {
  findCurrentHostFiber,
  findCurrentFiberUsingSlowPath,
} from 'react-reconciler/src/ReactFiberTreeReflection';
import getComponentNameFromType from 'shared/getComponentNameFromType';
import {HostComponent} from 'react-reconciler/src/ReactWorkTags';
// Module provided by RN:
import {
  UIManager,
  getNodeFromPublicInstance,
} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
import {getClosestInstanceFromNode} from './ReactNativeComponentTree';
import {
  getNodeFromInternalInstanceHandle,
  findNodeHandle,
} from './ReactNativePublicCompat';
import {getStackByFiberInDevAndProd} from 'react-reconciler/src/ReactFiberComponentStack';

let getInspectorDataForInstance: (
  closestInstance: Fiber | null,
) => InspectorData;

if (__DEV__) {
  const emptyObject = Object.freeze({});

  // $FlowFixMe[missing-local-annot]
  const createHierarchy = function (fiberHierarchy) {
    return fiberHierarchy.map(fiber => ({
      name: getComponentNameFromType(fiber.type),
      getInspectorData: () => {
        return {
          props: getHostProps(fiber),
          measure: callback => {
            // If this is Fabric, we'll find a shadow node and use that to measure.
            const hostFiber = findCurrentHostFiber(fiber);
            const node =
              hostFiber != null &&
              hostFiber.stateNode !== null &&
              hostFiber.stateNode.node;

            if (node) {
              nativeFabricUIManager.measure(node, callback);
            } else {
              return UIManager.measure(getHostNode(fiber), callback);
            }
          },
        };
      },
// ... (203 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does ReactNativeFiberInspector.js do?
ReactNativeFiberInspector.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 ReactNativeFiberInspector.js?
ReactNativeFiberInspector.js defines 3 function(s): createHierarchy, getHostNode, getHostProps.
What does ReactNativeFiberInspector.js depend on?
ReactNativeFiberInspector.js imports 11 module(s): ReactFiberComponentStack, ReactFiberTreeReflection, ReactInternalTypes, ReactNativeComponentTree.js, ReactNativePrivateInterface, ReactNativePublicCompat.js, ReactNativeTypes.js, ReactWorkTags, and 3 more.
What files import ReactNativeFiberInspector.js?
ReactNativeFiberInspector.js is imported by 2 file(s): ReactFiberConfigFabric.js, ReactFiberConfigNative.js.
Where is ReactNativeFiberInspector.js in the architecture?
ReactNativeFiberInspector.js is located at packages/react-native-renderer/src/ReactNativeFiberInspector.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