1

I'm building a feed like Facebook or Twitter using React. I need a list of posts... however, I don't know if it's worth having a virtual list or not.

I don't know the height of each post until it's been rendered as it might contain an image or a video, I also need the whole window to scroll (not just one element), and I need it to be an infinite list (to load more posts when the users reaches the bottom).

What benefits would I get from using a virtual list rather than simply displaying all posts? it seems like a lot of work to maintain and set up what I'm looking for.

Kwokamole
  • 53
  • 6
  • for starters do a "Load more" button at the end of the list. then next step should be to implement the virtual list. one hacky way to implement virtual list in ur case would be to have an invisible div and see if it comes in the viewport. if so then fetch more. this way u dont need to know the height of the list items – hannad rehman Nov 11 '20 at 10:50

0 Answers0