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
  3aff0de3_4afc_3cbb_aa8c_455e9a83489c["inject()"]
  d29b9def_f527_5cd3_81f2_47f19e0fe569["devtools.js"]
  3aff0de3_4afc_3cbb_aa8c_455e9a83489c -->|defined in| d29b9def_f527_5cd3_81f2_47f19e0fe569
  c7cef9d6_a084_3c3b_f389_5140e937f1eb["init()"]
  c7cef9d6_a084_3c3b_f389_5140e937f1eb -->|calls| 3aff0de3_4afc_3cbb_aa8c_455e9a83489c
  style 3aff0de3_4afc_3cbb_aa8c_455e9a83489c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shell/src/e2e/devtools.js lines 27–33

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

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

Domain

Subdomains

Called By

Frequently Asked Questions

What does inject() do?
inject() is a function in the react codebase, defined in packages/react-devtools-shell/src/e2e/devtools.js.
Where is inject() defined?
inject() is defined in packages/react-devtools-shell/src/e2e/devtools.js at line 27.
What calls inject()?
inject() is called by 1 function(s): init.

Analyze Your Own Codebase

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

Try Supermodel Free