
In the examples ( https://stackblitz.com/edit/react-byvqj ... 2Fdemo.js ) I can see that the initial array ( virtualCars ) has been preset to an empty array with a length of 100000. Now, this works, but if I provide an empty default array, the onLazyLoad function is called with {first:0, last:0}. Is this behavior correct? Shouldn't 'last' be calculated based on the viewport/itemSize? Basically what I am trying to say is, I cannot correctly load the initial data with the following changes from the example above:
* const [virtualCars, setVirtualCars] = useState([]) <-- empty initial array instead of Array.from({10000})
You can check the edited example here https://stackblitz.com/edit/react-ntffl ... %2Fdemo.js and check the console - last is always 0 and not calculated correctly.
Am I missing something?
Any help would be appreciated, thanks!