Skip to content

Commit 39d1b38

Browse files
committed
Improve comment
1 parent b0c6faa commit 39d1b38

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ https://github.com/user-attachments/assets/23c2d232-7f35-470e-98b4-156efaaf326a
7474

7575
### Example 2 - Fetchable Template
7676

77-
A lightweight wrapper around `ReactDataList` which provides a top-level [React.Suspense](https://react.dev/reference/react/Suspense) and [ErrorBoundary](https://react.dev/reference/react/Component#static-getderivedstatefromerror). This is useful for typical async work, where you may want to display skeleton rows (via `renderPending`), a full-screen spinner (via `renderPending`), or perhaps a full-screen error message (via `renderError`).
77+
A lightweight wrapper around `ReactDataList` which provides a top-level [React.Suspense](https://react.dev/reference/react/Suspense) and [ErrorBoundary](https://react.dev/reference/react/Component#static-getderivedstatefromerror). This is useful for typical async work, where you may want to display skeleton rows (via `renderPendingRows`), a full-screen spinner (via `renderPending`), or perhaps a full-screen error message (via `renderError`).
7878

7979
```tsx
8080
<ReactDataList.Fetchable

example/app/(tabs)/index.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ export default function HomeScreen() {
8787
/>
8888
}
8989
renderEmpty={() => (
90+
/**
91+
* This never happens as we're guaranteed rows will be
92+
* evaluated to data items on first paint.
93+
*/
9094
<View style={styles.alert}>
9195
<ErrorOnRenderCheck />
9296
</View>
@@ -109,7 +113,15 @@ export default function HomeScreen() {
109113
{isShowingThorinAndCompany && (
110114
<>
111115
<ListHeaderDataListRow title="Thorin and Company" />
112-
<React.Suspense fallback={<LoadingListItemDataListRow />}>
116+
<React.Suspense
117+
fallback={
118+
<>
119+
<LoadingListItemDataListRow />
120+
<LoadingListItemDataListRow />
121+
<LoadingListItemDataListRow />
122+
</>
123+
}
124+
>
113125
<MiddleEarthHobbitCompanyDataListRows />
114126
</React.Suspense>
115127
</>

0 commit comments

Comments
 (0)