Home / Function/ ActualSourceButton() — react Function Reference

ActualSourceButton() — react Function Reference

Architecture documentation for the ActualSourceButton() function in InspectedElementViewSourceButton.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a6c6d6fe_e6d3_99f3_01a3_d70f789cb90e["ActualSourceButton()"]
  e1b4c141_a4b7_37b7_6892_efa866707492["InspectedElementViewSourceButton.js"]
  a6c6d6fe_e6d3_99f3_01a3_d70f789cb90e -->|defined in| e1b4c141_a4b7_37b7_6892_efa866707492
  style a6c6d6fe_e6d3_99f3_01a3_d70f789cb90e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementViewSourceButton.js lines 48–69

function ActualSourceButton({
  source,
  symbolicatedSourcePromise,
}: ActualSourceButtonProps): React.Node {
  const symbolicatedSource =
    symbolicatedSourcePromise == null
      ? null
      : React.use(symbolicatedSourcePromise);

  const [buttonIsEnabled, viewSource] = useOpenResource(
    source,
    symbolicatedSource == null ? null : symbolicatedSource.location,
  );
  return (
    <Button
      disabled={!buttonIsEnabled}
      onClick={viewSource}
      title="View source for this element">
      <ButtonIcon type="view-source" />
    </Button>
  );
}

Domain

Subdomains

Frequently Asked Questions

What does ActualSourceButton() do?
ActualSourceButton() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/views/Components/InspectedElementViewSourceButton.js.
Where is ActualSourceButton() defined?
ActualSourceButton() is defined in packages/react-devtools-shared/src/devtools/views/Components/InspectedElementViewSourceButton.js at line 48.

Analyze Your Own Codebase

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

Try Supermodel Free