MCPcopy Create free account
hub / github.com/bvaughn/react-window / updateItemSizes

Function updateItemSizes

lib/components/virtualizer/useVirtualizer.test.tsx:254–260  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

252 // setting the size function notifies observers of the new sizes
253 const itemHeights = new Map<number, number>();
254 const updateItemSizes = () =>
255 setElementSizeFunction((element) => {
256 if (element.getAttribute("data-testid") === "item") {
257 const index = Number(element.getAttribute("data-index"));
258 return new DOMRect(0, 0, 100, itemHeights.get(index) ?? 25);
259 }
260 });
261 updateItemSizes();
262
263 const virtualizerRef = createRef<Virtualizer>();

Callers 1

Calls 1

setElementSizeFunctionFunction · 0.90

Tested by

no test coverage detected