Home / Function/ truncateDepAtCurrent() — react Function Reference

truncateDepAtCurrent() — react Function Reference

Architecture documentation for the truncateDepAtCurrent() function in InferEffectDependencies.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  af90f530_fefd_4286_d27e_d198190f06bf["truncateDepAtCurrent()"]
  3393f920_76eb_7dd5_b95f_ab92de6cecce["InferEffectDependencies.ts"]
  af90f530_fefd_4286_d27e_d198190f06bf -->|defined in| 3393f920_76eb_7dd5_b95f_ab92de6cecce
  3522f83b_2dff_3c9f_920f_3e428eb62b31["inferEffectDependencies()"]
  3522f83b_2dff_3c9f_920f_3e428eb62b31 -->|calls| af90f530_fefd_4286_d27e_d198190f06bf
  style af90f530_fefd_4286_d27e_d198190f06bf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Inference/InferEffectDependencies.ts lines 353–362

function truncateDepAtCurrent(
  dep: ReactiveScopeDependency,
): ReactiveScopeDependency {
  const idx = dep.path.findIndex(path => path.property === 'current');
  if (idx === -1) {
    return dep;
  } else {
    return {...dep, path: dep.path.slice(0, idx)};
  }
}

Domain

Subdomains

Frequently Asked Questions

What does truncateDepAtCurrent() do?
truncateDepAtCurrent() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferEffectDependencies.ts.
Where is truncateDepAtCurrent() defined?
truncateDepAtCurrent() is defined in compiler/packages/babel-plugin-react-compiler/src/Inference/InferEffectDependencies.ts at line 353.
What calls truncateDepAtCurrent()?
truncateDepAtCurrent() is called by 1 function(s): inferEffectDependencies.

Analyze Your Own Codebase

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

Try Supermodel Free