Home / Function/ FormattedSourceString() — react Function Reference

FormattedSourceString() — react Function Reference

Architecture documentation for the FormattedSourceString() function in InspectedElementSourcePanel.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  67de64c0_e785_eb7f_1bf3_db84aa6cc712["FormattedSourceString()"]
  50c39210_7831_dde4_3a12_fc8ea644bc38["InspectedElementSourcePanel.js"]
  67de64c0_e785_eb7f_1bf3_db84aa6cc712 -->|defined in| 50c39210_7831_dde4_3a12_fc8ea644bc38
  0387a47c_28df_b84f_2410_96bf24210782["formatLocationForDisplay()"]
  67de64c0_e785_eb7f_1bf3_db84aa6cc712 -->|calls| 0387a47c_28df_b84f_2410_96bf24210782
  style 67de64c0_e785_eb7f_1bf3_db84aa6cc712 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSourcePanel.js lines 97–120

function FormattedSourceString({source, symbolicatedSourcePromise}: Props) {
  const symbolicatedSource = React.use(symbolicatedSourcePromise);

  const [linkIsEnabled, viewSource] = useOpenResource(
    source,
    symbolicatedSource == null ? null : symbolicatedSource.location,
  );

  const [, sourceURL, line, column] =
    symbolicatedSource == null ? source : symbolicatedSource.location;

  return (
    <div
      className={styles.SourceOneLiner}
      data-testname="InspectedElementView-FormattedSourceString">
      <span
        className={linkIsEnabled ? styles.Link : null}
        title={sourceURL + ':' + line}
        onClick={viewSource}>
        {formatLocationForDisplay(sourceURL, line, column)}
      </span>
    </div>
  );
}

Domain

Subdomains

Frequently Asked Questions

What does FormattedSourceString() do?
FormattedSourceString() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSourcePanel.js.
Where is FormattedSourceString() defined?
FormattedSourceString() is defined in packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSourcePanel.js at line 97.
What does FormattedSourceString() call?
FormattedSourceString() calls 1 function(s): formatLocationForDisplay.

Analyze Your Own Codebase

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

Try Supermodel Free