MCPcopy Create free account
hub / github.com/caseywebdev/react-list / getVisibleRange

Method getVisibleRange

src/react-list.js:469–481  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

467 }
468
469 getVisibleRange() {
470 const { from, size } = this.state;
471 const { start, end } = this.getStartAndEnd(0);
472 const cache = {};
473 let first, last;
474 for (let i = from; i < from + size; ++i) {
475 const itemStart = this.getSpaceBefore(i, cache);
476 const itemEnd = itemStart + this.getSizeOfItem(i);
477 if (first == null && itemEnd > start) first = i;
478 if (first != null && itemStart < end) last = i;
479 }
480 return [first, last];
481 }
482
483 renderItems() {
484 const { itemRenderer, itemsRenderer } = this.props;

Callers

nothing calls this directly

Calls 3

getStartAndEndMethod · 0.95
getSpaceBeforeMethod · 0.95
getSizeOfItemMethod · 0.95

Tested by

no test coverage detected