https://github.com/maxam2017/infinite-list-with-suspense
This is a simple example of how to create an infinite list with React Suspense.
https://github.com/maxam2017/infinite-list-with-suspense
Last synced: 11 months ago
JSON representation
This is a simple example of how to create an infinite list with React Suspense.
- Host: GitHub
- URL: https://github.com/maxam2017/infinite-list-with-suspense
- Owner: maxam2017
- Created: 2024-05-12T11:46:53.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-12T13:24:56.000Z (about 2 years ago)
- Last Synced: 2025-04-10T19:46:44.149Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://infinite-list-with-suspense.pages.dev
- Size: 220 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# infinite-list-with-suspense
This is a simple example of how to create an infinite list with React Suspense.
I'm not sure if this is the best way to do it, but it works.
If you have any suggestions, please let me know.
## Explanation
Before React introduced "the Suspense for Data Fetching", implementing infinite lists involved triggering data fetching as the user scrolled to the bottom of the list. Upon fetching data, it was appended to the list, and the state was updated accordingly.
However, with Suspense, we can bind the data fetching to the component and let React handle the data fetching for us.