Home / Function/ return() — react Function Reference

return() — react Function Reference

Architecture documentation for the return() function in index.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  2e3c3d6a_54ee_ebd5_f164_d4b8a5fcf4a9["return()"]
  1fe61eb6_8e55_40d8_4d18_db1927e3d6fd["index.js"]
  2e3c3d6a_54ee_ebd5_f164_d4b8a5fcf4a9 -->|defined in| 1fe61eb6_8e55_40d8_4d18_db1927e3d6fd
  a06ea974_2987_ab24_d4ec_5ad8921dd344["flattenHooksList()"]
  2e3c3d6a_54ee_ebd5_f164_d4b8a5fcf4a9 -->|calls| a06ea974_2987_ab24_d4ec_5ad8921dd344
  c1ede884_eff1_5699_b978_8ab7d7207919["loadSourceAndMetadata()"]
  2e3c3d6a_54ee_ebd5_f164_d4b8a5fcf4a9 -->|calls| c1ede884_eff1_5699_b978_8ab7d7207919
  fba84d46_f44f_7ea7_9af3_a0121e3e1415["parseSourceAndMetadata()"]
  2e3c3d6a_54ee_ebd5_f164_d4b8a5fcf4a9 -->|calls| fba84d46_f44f_7ea7_9af3_a0121e3e1415
  style 2e3c3d6a_54ee_ebd5_f164_d4b8a5fcf4a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/hooks/parseHookNames/index.js lines 39–62

export async function parseHookNames(
  hooksTree: HooksTree,
  fetchFileWithCaching: FetchFileWithCaching | null,
): Promise<HookNames | null> {
  return withAsyncPerfMeasurements('parseHookNames', async () => {
    const hooksList = flattenHooksList(hooksTree);
    if (hooksList.length === 0) {
      // This component tree contains no named hooks.
      return EMPTY_MAP;
    }

    // Runs on the main/UI thread so it can reuse Network cache:
    const locationKeyToHookSourceAndMetadata = await loadSourceAndMetadata(
      hooksList,
      fetchFileWithCaching,
    );

    // Runs in a Worker because it's CPU intensive:
    return parseSourceAndMetadata(
      hooksList,
      locationKeyToHookSourceAndMetadata,
    );
  });
}

Domain

Subdomains

Frequently Asked Questions

What does return() do?
return() is a function in the react codebase, defined in packages/react-devtools-shared/src/hooks/parseHookNames/index.js.
Where is return() defined?
return() is defined in packages/react-devtools-shared/src/hooks/parseHookNames/index.js at line 39.
What does return() call?
return() calls 3 function(s): flattenHooksList, loadSourceAndMetadata, parseSourceAndMetadata.

Analyze Your Own Codebase

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

Try Supermodel Free