Home / Function/ getSourceLocationByFiber() — react Function Reference

getSourceLocationByFiber() — react Function Reference

Architecture documentation for the getSourceLocationByFiber() function in DevToolsFiberComponentStack.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  011ebe97_56a8_fc8d_3526_ba9639088335["getSourceLocationByFiber()"]
  2bbfa631_5780_6883_1746_b7c42df10b5d["DevToolsFiberComponentStack.js"]
  011ebe97_56a8_fc8d_3526_ba9639088335 -->|defined in| 2bbfa631_5780_6883_1746_b7c42df10b5d
  e40d98f8_c5d4_65cc_ca5e_14ef53f81450["describeFiber()"]
  011ebe97_56a8_fc8d_3526_ba9639088335 -->|calls| e40d98f8_c5d4_65cc_ca5e_14ef53f81450
  style 011ebe97_56a8_fc8d_3526_ba9639088335 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/backend/fiber/DevToolsFiberComponentStack.js lines 117–132

export function getSourceLocationByFiber(
  workTagMap: WorkTagMap,
  fiber: Fiber,
  currentDispatcherRef: CurrentDispatcherRef,
): null | string {
  // This is like getStackByFiberInDevAndProd but just the first stack frame.
  try {
    const info = describeFiber(workTagMap, fiber, currentDispatcherRef);
    if (info !== '') {
      return info.slice(1); // skip the leading newline
    }
  } catch (x) {
    console.error(x);
  }
  return null;
}

Domain

Subdomains

Frequently Asked Questions

What does getSourceLocationByFiber() do?
getSourceLocationByFiber() is a function in the react codebase, defined in packages/react-devtools-shared/src/backend/fiber/DevToolsFiberComponentStack.js.
Where is getSourceLocationByFiber() defined?
getSourceLocationByFiber() is defined in packages/react-devtools-shared/src/backend/fiber/DevToolsFiberComponentStack.js at line 117.
What does getSourceLocationByFiber() call?
getSourceLocationByFiber() calls 1 function(s): describeFiber.

Analyze Your Own Codebase

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

Try Supermodel Free