Project-Chirp / chirp-frontend

Frontend of Chirp
2 stars 3 forks source link

T84: Infinite scroll #99

Open NasihNazeem opened 4 months ago

NasihNazeem commented 4 months ago

Closes #84. Introduces infinite scroll using libraries such as @tanstack/react-query for infinite querying, and react-infinite-scroll-component for making scrollable components. A new hook, useFetchPosts, was introduced that takes a unique URL, and a designated userId to fetch data depending on the page.

PostLists within the timeline, profile page and direct messages pages now have infinite scroll integrated This PR also resolves #70.

Dennull commented 1 month ago

As discussed offline, we'll convert this back to a draft while we figure out the best way to move forward. I think there's some confusion between how we're managing client side and server side state. If we want to introduce the react query library into the app we might want to change how we're managing our server side state in general, so we should probably fully understand that before implementing infinite scroll