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 (
|
return (
|
||||||
<View testID={testID} style={style}>
|
<View testID={testID} style={style}>
|
||||||
{feed.isLoading && !data && <PostFeedLoadingPlaceholder />}
|
{feed.isLoading && data.length === 0 && (
|
||||||
{data && (
|
<View style={{paddingTop: headerOffset}}>
|
||||||
|
<PostFeedLoadingPlaceholder />
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
{data.length > 0 && (
|
||||||
<FlatList
|
<FlatList
|
||||||
ref={scrollElRef}
|
ref={scrollElRef}
|
||||||
data={data}
|
data={data}
|
||||||
|
|||||||
Reference in New Issue
Block a user