Skip to content

New items aren't rendered while scrolling #13

@bandtank

Description

@bandtank

Here is my code:

import ReactScrollableList from 'react-scrollable-list';

let listItems = []
for (let i = 0; i < 10000; i++) {
  listItems.push({ id: i, content: <div>List Item {i}</div>})
}

function App() {
  return (
    <ReactScrollableList
      listItems={listItems}
    />
  );

}
export default App;

The page renders with 10 visible elements and it scrolls as expected, but new items do not render.

image

image

What am I doing wrong? The heightOfItem property doesn't seem to do anything either. No matter what I set it to, the height of the elements stays the same.

$ npm --version
6.14.5
$ node --version
v14.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions