Home / Function/ getDepth() — react Function Reference

getDepth() — react Function Reference

Architecture documentation for the getDepth() function in preprocessData.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a0367c41_f3a0_3eeb_b9ba_03c10fc3a4b1["getDepth()"]
  a3f7147d_da0b_56dc_ffc9_a9e2bbc4526a["preprocessData.js"]
  a0367c41_f3a0_3eeb_b9ba_03c10fc3a4b1 -->|defined in| a3f7147d_da0b_56dc_ffc9_a9e2bbc4526a
  facf3681_3bf5_7bbe_6910_334d216abf41["markWorkStarted()"]
  facf3681_3bf5_7bbe_6910_334d216abf41 -->|calls| a0367c41_f3a0_3eeb_b9ba_03c10fc3a4b1
  style a0367c41_f3a0_3eeb_b9ba_03c10fc3a4b1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-timeline/src/import-worker/preprocessData.js lines 135–141

function getDepth(stack: ProcessorState['measureStack']) {
  if (stack.length > 0) {
    const {depth, type} = stack[stack.length - 1];
    return type === 'render-idle' ? depth : depth + 1;
  }
  return 0;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getDepth() do?
getDepth() is a function in the react codebase, defined in packages/react-devtools-timeline/src/import-worker/preprocessData.js.
Where is getDepth() defined?
getDepth() is defined in packages/react-devtools-timeline/src/import-worker/preprocessData.js at line 135.
What calls getDepth()?
getDepth() is called by 1 function(s): markWorkStarted.

Analyze Your Own Codebase

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

Try Supermodel Free