Home / Function/ setBoundingClientRect() — react Function Reference

setBoundingClientRect() — react Function Reference

Architecture documentation for the setBoundingClientRect() function in IntersectionMocks.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  96f51cee_968a_ad3c_cf32_c21614896266["setBoundingClientRect()"]
  401ac3c1_db64_239a_36cd_82c9b882e0ea["IntersectionMocks.js"]
  96f51cee_968a_ad3c_cf32_c21614896266 -->|defined in| 401ac3c1_db64_239a_36cd_82c9b882e0ea
  style 96f51cee_968a_ad3c_cf32_c21614896266 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom/src/__tests__/utils/IntersectionMocks.js lines 66–77

export function setBoundingClientRect(target, {x, y, width, height}) {
  target.getBoundingClientRect = function () {
    return {
      width,
      height,
      left: x,
      right: x + width,
      top: y,
      bottom: y + height,
    };
  };
}

Domain

Subdomains

Frequently Asked Questions

What does setBoundingClientRect() do?
setBoundingClientRect() is a function in the react codebase, defined in packages/react-dom/src/__tests__/utils/IntersectionMocks.js.
Where is setBoundingClientRect() defined?
setBoundingClientRect() is defined in packages/react-dom/src/__tests__/utils/IntersectionMocks.js at line 66.

Analyze Your Own Codebase

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

Try Supermodel Free