Fix RN bug that causes home feed not to load more; also fix home feed load view. (#208)

RN has a bug where rendering a flatlist with an empty array appears to break its
virtual list windowing behaviors. See https://stackoverflow.com/a/67873596
This commit is contained in:
Paul Frazee
2023-02-15 12:48:39 -06:00
committed by GitHub
parent d6f34d8b86
commit b05a3146b7
+6 -2
View File
@@ -98,8 +98,12 @@ export const Feed = observer(function Feed({
)
return (
<View testID={testID} style={style}>
{feed.isLoading && !data && <PostFeedLoadingPlaceholder />}
{data && (
{feed.isLoading && data.length === 0 && (
<View style={{paddingTop: headerOffset}}>
<PostFeedLoadingPlaceholder />
</View>
)}
{data.length > 0 && (
<FlatList
ref={scrollElRef}
data={data}