Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Explore] Add flatlist perf-related props (#8120)

* Add flatlist perf-related props

* Make keys more unique

* Small gap

---------

Co-authored-by: Eric Bailey <git@esb.lol>

authored by

Samuel Newman
Eric Bailey
and committed by
GitHub
ceb51c7e 22a71994

+11 -3
+8 -2
src/screens/Search/Explore.tsx
··· 8 8 import {msg, Trans} from '@lingui/macro' 9 9 import {useLingui} from '@lingui/react' 10 10 11 + import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender' 11 12 import {useGate} from '#/lib/statsig/statsig' 12 13 import {cleanError} from '#/lib/strings/errors' 13 14 import {sanitizeHandle} from '#/lib/strings/handles' ··· 38 39 import {ExploreRecommendations} from '#/screens/Search/modules/ExploreRecommendations' 39 40 import {ExploreTrendingTopics} from '#/screens/Search/modules/ExploreTrendingTopics' 40 41 import {ExploreTrendingVideos} from '#/screens/Search/modules/ExploreTrendingVideos' 41 - import {atoms as a, native, useTheme, web} from '#/alf' 42 + import {atoms as a, native, platform, useTheme, web} from '#/alf' 42 43 import {Button} from '#/components/Button' 43 44 import * as FeedCard from '#/components/FeedCard' 44 45 import {ChevronBottom_Stroke2_Corner0_Rounded as ChevronDownIcon} from '#/components/icons/Chevron' ··· 190 191 }) { 191 192 const {_} = useLingui() 192 193 const t = useTheme() 194 + const initialNumToRender = useInitialNumToRender() 193 195 const {data: preferences, error: preferencesError} = usePreferencesQuery() 194 196 const moderationOpts = useModerationOpts() 195 197 const gate = useGate() ··· 923 925 viewabilityConfig={viewabilityConfig} 924 926 onViewableItemsChanged={onViewableItemsChanged} 925 927 onEndReached={onLoadMoreFeedPreviews} 926 - onEndReachedThreshold={2} 928 + onEndReachedThreshold={3} 929 + initialNumToRender={initialNumToRender} 930 + windowSize={9} 931 + maxToRenderPerBatch={platform({ios: 5, default: 1})} 932 + updateCellsBatchingPeriod={40} 927 933 /> 928 934 ) 929 935 }
+2
src/screens/Search/components/ModuleHeader.tsx
··· 41 41 headerHeight && web({position: 'sticky', top: headerHeight}), 42 42 style, 43 43 ]}> 44 + {/* Very non-scientific way to avoid small gap on scroll */} 45 + <View style={[a.absolute, a.inset_0, t.atoms.bg, {top: -2}]} /> 44 46 {children} 45 47 </View> 46 48 )
+1 -1
src/state/queries/explore-feed-previews.tsx
··· 173 173 }) 174 174 175 175 const slice = { 176 - _reactKey: item._reactKey, 176 + _reactKey: page.feed.uri + item._reactKey, 177 177 _isFeedPostSlice: true, 178 178 isFallbackMarker: false, 179 179 isIncompleteThread: item.isIncompleteThread,