Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lesenelir/suspense
Data fetching with React Suspense Component.
https://github.com/lesenelir/suspense
Last synced: 9 days ago
JSON representation
Data fetching with React Suspense Component.
- Host: GitHub
- URL: https://github.com/lesenelir/suspense
- Owner: lesenelir
- Created: 2023-08-23T09:14:29.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-08-24T15:23:52.000Z (about 1 year ago)
- Last Synced: 2024-04-10T19:17:37.354Z (7 months ago)
- Language: TypeScript
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# suspense
Data fetching with React Suspense Component.
### 3 ways to fetch data in React
- Render, and then fetch
- Fetch, and then render
- fetch early, get a response early- Render as you fetch
- Initiate Data Fetching: Start fetching data before rendering UI.
- Initiate Rendering: Begin rendering immediately without waiting for data to complete.
- Suspense for handling loading state: render a fallback before the data is prepared.
- Render Final UI: Once the data is ready, complete the component's rendering.