Home / Function/ getOrCreatePropertyEntry() — react Function Reference

getOrCreatePropertyEntry() — react Function Reference

Architecture documentation for the getOrCreatePropertyEntry() function in CollectHoistablePropertyLoads.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a6cc066a_d685_3022_a631_437bad493e6d["getOrCreatePropertyEntry()"]
  50c372df_146d_1b4c_de3a_0589d6591a75["PropertyPathRegistry"]
  a6cc066a_d685_3022_a631_437bad493e6d -->|defined in| 50c372df_146d_1b4c_de3a_0589d6591a75
  afcd35a2_87ac_64f3_d39b_e78954698dc0["getOrCreateProperty()"]
  afcd35a2_87ac_64f3_d39b_e78954698dc0 -->|calls| a6cc066a_d685_3022_a631_437bad493e6d
  bc0d4a49_256e_973f_feb6_ed785896b72b["reduceMaybeOptionalChains()"]
  bc0d4a49_256e_973f_feb6_ed785896b72b -->|calls| a6cc066a_d685_3022_a631_437bad493e6d
  style a6cc066a_d685_3022_a631_437bad493e6d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/HIR/CollectHoistablePropertyLoads.ts lines 278–299

  static getOrCreatePropertyEntry(
    parent: PropertyPathNode,
    entry: DependencyPathEntry,
  ): PropertyPathNode {
    const map = entry.optional ? parent.optionalProperties : parent.properties;
    let child = map.get(entry.property);
    if (child == null) {
      child = {
        properties: new Map(),
        optionalProperties: new Map(),
        parent: parent,
        fullPath: {
          identifier: parent.fullPath.identifier,
          reactive: parent.fullPath.reactive,
          path: parent.fullPath.path.concat(entry),
        },
        hasOptional: parent.hasOptional || entry.optional,
      };
      map.set(entry.property, child);
    }
    return child;
  }

Subdomains

Frequently Asked Questions

What does getOrCreatePropertyEntry() do?
getOrCreatePropertyEntry() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/HIR/CollectHoistablePropertyLoads.ts.
Where is getOrCreatePropertyEntry() defined?
getOrCreatePropertyEntry() is defined in compiler/packages/babel-plugin-react-compiler/src/HIR/CollectHoistablePropertyLoads.ts at line 278.
What calls getOrCreatePropertyEntry()?
getOrCreatePropertyEntry() is called by 2 function(s): getOrCreateProperty, reduceMaybeOptionalChains.

Analyze Your Own Codebase

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

Try Supermodel Free