question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

isRowLoaded property - confusing name and documentation

See original GitHub issue

isRowLoaded property used by InfiniteLoader to detect which rows was already requested, to avoid multiple call loadMoreRows. So it should be called isRowRequested? Example in ifiniteloader documentation pretty confused https://github.com/bvaughn/react-virtualized/blob/master/docs/InfiniteLoader.md#examples

function isRowLoaded ({ index }) {
  return !!list[index];
}

function loadMoreRows ({ startIndex, stopIndex }) {
  return fetch(`path/to/api?startIndex=${startIndex}&stopIndex=${stopIndex}`)
    .then(response => {
      // Store response data in list...
    })
}

It looks like you need just “Store response data in list…” but if you’ll do like that you will get the issue with multiple calls of LoadMoreRows because of response delay.

But in the code example this point is pretty clear https://github.com/bvaughn/react-virtualized/blob/master/source/InfiniteLoader/InfiniteLoader.example.js#L111

It took me a long time before I discovered the problem, maybe I have a problem understanding, but mentioning these points would help me a lot and save time. Thank You.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
fatfatsoncommented, Aug 9, 2018

thanks for pointing out it @VladimirPal , i’m confusing about why loadMoreRows called multiple with overlapped range

2reactions
jedwards1211commented, Nov 28, 2018

isRowLoadingOrLoaded or shouldRequestRow are the only 100% clear names for the property, since the user code may later decide to unload rows if the user scrolls too far (and should – loading rows until the browser runs out of memory is not responsible programming).

isRowRequested is too vague about the difference between a) if the row has ever been requested, but was later unloaded, and b) the row is actually currently loading or loaded.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react virtualized - Undefined index after loadMoreRows is called
Could be that I'm misusing the two rowCount props. You should pass the same rowCount value to both InfiniteLoader and Table .
Read more >
react-virtualized - Bountysource
isRowLoaded property used by InfiniteLoader to detect which rows was already ... confused https://github.com/bvaughn/react-virtualized/blob/master/docs/ ...
Read more >
release notes for Qt 6.2 - Qt Project Git Repository Browser
Release note. Qt 6.2 introduces many new features and improvements as well as bugfixes over the 6.1.x series. For more details, refer to...
Read more >
Update qt6 to version 6.2.0
e906bb84fb QFlags: add (named) explicit conversion from/to int ... To document a default QML property, use the new \qmlproperty command.
Read more >
Mui datagrid getselectedrows. id. 1 Error: Material-UI: The data...
I saw in the element document that there is a controlled selection but I ... By default, the data grid looks for a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found