MCPcopy
hub / github.com/react/react / setClientRects

Function setClientRects

packages/react-dom/src/__tests__/utils/IntersectionMocks.js:82–95  ·  view source on GitHub ↗
(target, rects)

Source from the content-addressed store, hash-verified

80 * Stub out getClientRects for the specified target.
81 */
82export function setClientRects(target, rects) {
83 target.getClientRects = function () {
84 return rects.map(({x, y, width, height}) => ({
85 width,
86 height,
87 left: x,
88 right: x + width,
89 top: y,
90 bottom: y + height,
91 x,
92 y,
93 }));
94 };
95}

Callers 1

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected