MCPcopy
hub / github.com/bbycroft/llm-viz / handleChange

Function handleChange

src/utils/Portal.tsx:126–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124
125 useLayoutEffect(() => {
126 function handleChange() {
127 let bcr = el ? el.getBoundingClientRect() : null;
128 setBcr(prev => (el && prev) ? assignImm(prev, {
129 x: includePosition ? bcr!.x : 0,
130 y: includePosition ? bcr!.y : 0,
131 width: bcr!.width,
132 height: bcr!.height,
133 }) : bcr);
134 }
135
136 if (el) {
137 let observer = new ResizeObserver(handleChange);

Callers 1

useWatchElementRectFunction · 0.85

Calls 1

assignImmFunction · 0.90

Tested by

no test coverage detected