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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user