Home / Function/ getTagFromInstance() — react Function Reference

getTagFromInstance() — react Function Reference

Architecture documentation for the getTagFromInstance() function in ReactNativeComponentTree.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  557277e5_375f_0d16_8ed4_ca2eae5ed2e8["getTagFromInstance()"]
  6558eedc_539e_2a0a_77c0_574f399b3f4a["ReactNativeComponentTree.js"]
  557277e5_375f_0d16_8ed4_ca2eae5ed2e8 -->|defined in| 6558eedc_539e_2a0a_77c0_574f399b3f4a
  style 557277e5_375f_0d16_8ed4_ca2eae5ed2e8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-native-renderer/src/ReactNativeComponentTree.js lines 24–38

function getTagFromInstance(inst) {
  let nativeInstance = inst.stateNode;
  let tag = nativeInstance._nativeTag;
  if (tag === undefined && nativeInstance.canonical != null) {
    // For compatibility with Fabric
    tag = nativeInstance.canonical.nativeTag;
    nativeInstance = nativeInstance.canonical.publicInstance;
  }

  if (!tag) {
    throw new Error('All native instances should have a tag.');
  }

  return nativeInstance;
}

Domain

Subdomains

Frequently Asked Questions

What does getTagFromInstance() do?
getTagFromInstance() is a function in the react codebase, defined in packages/react-native-renderer/src/ReactNativeComponentTree.js.
Where is getTagFromInstance() defined?
getTagFromInstance() is defined in packages/react-native-renderer/src/ReactNativeComponentTree.js at line 24.

Analyze Your Own Codebase

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

Try Supermodel Free