Home / Function/ getData() — react Function Reference

getData() — react Function Reference

Architecture documentation for the getData() function in renderer.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4aa16541_e301_4ecc_08b7_298b2c74473b["getData()"]
  27444ff2_8253_76db_da6c_4967b0d20cee["renderer.js"]
  4aa16541_e301_4ecc_08b7_298b2c74473b -->|defined in| 27444ff2_8253_76db_da6c_4967b0d20cee
  0bf1ec3e_7bcf_3a31_d050_f4e3bd960b04["attach()"]
  0bf1ec3e_7bcf_3a31_d050_f4e3bd960b04 -->|calls| 4aa16541_e301_4ecc_08b7_298b2c74473b
  style 4aa16541_e301_4ecc_08b7_298b2c74473b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/backend/legacy/renderer.js lines 62–84

function getData(internalInstance: InternalInstance) {
  let displayName = null;
  let key = null;

  // != used deliberately here to catch undefined and null
  if (internalInstance._currentElement != null) {
    if (internalInstance._currentElement.key) {
      key = String(internalInstance._currentElement.key);
    }

    const elementType = internalInstance._currentElement.type;
    if (typeof elementType === 'string') {
      displayName = elementType;
    } else if (typeof elementType === 'function') {
      displayName = getDisplayName(elementType);
    }
  }

  return {
    displayName,
    key,
  };
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getData() do?
getData() is a function in the react codebase, defined in packages/react-devtools-shared/src/backend/legacy/renderer.js.
Where is getData() defined?
getData() is defined in packages/react-devtools-shared/src/backend/legacy/renderer.js at line 62.
What calls getData()?
getData() is called by 1 function(s): attach.

Analyze Your Own Codebase

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

Try Supermodel Free