0

I'm implementing a scroll feed of images, each "row" displays only one image, same as the feed of Instagram. I'm using React & Firebase to implement it, and I'm trying to figure out - what is the best way to implement it? Paging? infinite scroll? react virtualized? something else? Because I use Firebase, I want it to use as less as "firebase resources" as I can, and of course that I also want to load the images quick.

Thank you!

1 Answers1

0

You ofcourse need pagination for this. You can combine pagination with infinite scroll to give user, better interactivity and reduce your cost.

For example, you load all the data from Firebase in batches (each of 5-10 whatever suits you) and as the user keeps scrolling, you gradually gets more and more data in batches.

s_o_m_m_y_e_e
  • 406
  • 4
  • 9
  • Pagination in firebase is really difficult to implement. – Ajay Gupta Sep 28 '20 at 11:28
  • Although, I'm not into react but there's not much difficulty in setting pagination in Firebase. You can follow some tutorials out there and once you get to know it. There would be not much trouble. You can refer here for pagination in reactjs https://stackoverflow.com/questions/53044791/how-to-paginate-cloud-firestore-data-with-reactjs – s_o_m_m_y_e_e Sep 28 '20 at 11:45