diff --git a/src/view/com/util/List.web.tsx b/src/view/com/util/List.web.tsx index 018ca0065b..e917ab1d32 100644 --- a/src/view/com/util/List.web.tsx +++ b/src/view/com/util/List.web.tsx @@ -73,6 +73,8 @@ function ListImpl( ) } + const isEmpty = !data || data.length === 0 + let headerComponent: JSX.Element | null = null if (ListHeaderComponent != null) { if (isValidElement(ListHeaderComponent)) { @@ -334,7 +336,7 @@ function ListImpl( onVisibleChange={handleAboveTheFoldVisibleChange} style={[styles.aboveTheFoldDetector, {height: headerOffset}]} /> - {onStartReached && ( + {onStartReached && !isEmpty && ( ( /> )} {headerComponent} - {!data || data.length === 0 + {isEmpty ? emptyComponent : (data as Array)?.map((item, index) => { const key = keyExtractor!(item, index) @@ -358,7 +360,7 @@ function ListImpl( /> ) })} - {onEndReached && ( + {onEndReached && !isEmpty && (