reddit-but-its-tiktok icon indicating copy to clipboard operation
reddit-but-its-tiktok copied to clipboard

Final changes to suggest

Open jlong5795 opened this issue 4 years ago • 0 comments

Issue #13

So I figured out how to enable the user to infinitely scroll, but I can't figure a way to do it without causing MAJOR merge conflicts if anyone else is actively working on this project. I have created a custom hook that will do most of the work for you, and here are the instructions on how to implement the rest:

  1. Change the DevURL back to it's Prod pointer. This now lives in the custom hook usePosts
  2. In the HOME component you'll find the hook imported and implemented. You need three things from that object: data, canFetchMore, and fetchMore.
  3. This library is designed to not need redux so simply pass those props to the component that does the rendering, map over the data set to render. Connect the fetchMore function to the mechanism that scrolls down the page and have it set to be disabled if canFetchMore returns false (means no more results).

This was the simplest way I could think of to do this without causing you a huge headache. Please let me know if you have questions as I'm happy to work through this with you if you'd like.

jlong5795 avatar Oct 23 '20 01:10 jlong5795