petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.25k stars 301 forks source link

Endless scroll with fetch API #657

Closed Pavelhaj93 closed 2 years ago

Pavelhaj93 commented 2 years ago

Hello,

I have a test interview for React Developer in React.js . I have a task to fetch API and use your Virtuoso to make a list with Endless Scroll and with each scroll to bottom fetch 10 more items. From your documentation I can see that it is pretty easy if you have the data already. I mean I could to endless scroll and I can fetch data but I dont know how to connect it together. I am wondering what is the generateUsers in your documentation because you import it there but dont show what it does. If you could help me I would really appreciate it.

Thanks,

Pavel

petyosi commented 2 years ago

You can open any of the source code examples from the docs in codesandbox and examine the implementation there.

Pavelhaj93 commented 2 years ago

Thank you I know but there is not a single example how to pass fetched data into itemContent, like how to map through an fetched data and show them in the Virtuoso list. Could you guide me to any documentation about it ? As I see all the data shown in examples are hardcoded.

Thanks a lot

Pavelhaj93 commented 2 years ago

I figured it out, missed data={users} sry I am stupid.