Home / Function/ inject() — react Function Reference

inject() — react Function Reference

Architecture documentation for the inject() function in devtools.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  23265ea7_1b3e_2379_2a16_0747d4f8d431["inject()"]
  bb15f9d0_445a_f9fe_a53c_ebedc812876a["devtools.js"]
  23265ea7_1b3e_2379_2a16_0747d4f8d431 -->|defined in| bb15f9d0_445a_f9fe_a53c_ebedc812876a
  style 23265ea7_1b3e_2379_2a16_0747d4f8d431 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shell/src/app/devtools.js lines 84–90

function inject(sourcePath: string, callback: () => void) {
  const script = contentDocument.createElement('script');
  script.onload = callback;
  script.src = sourcePath;

  ((contentDocument.body: any): HTMLBodyElement).appendChild(script);
}

Domain

Subdomains

Frequently Asked Questions

What does inject() do?
inject() is a function in the react codebase, defined in packages/react-devtools-shell/src/app/devtools.js.
Where is inject() defined?
inject() is defined in packages/react-devtools-shell/src/app/devtools.js at line 84.

Analyze Your Own Codebase

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

Try Supermodel Free