Adjust FlatList performance in main feeds (#3134)

* adjust flatlist perf settings

* calculate initial num to render based on screen height

* adjust window size

* don't react to screen height changes
This commit is contained in:
Hailey 2024-03-06 15:33:23 -08:00 committed by GitHub
parent 357b61d0a5
commit 8b0e575f64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View file

@ -22,6 +22,7 @@ import {ArrowOutOfBox_Stroke2_Corner0_Rounded} from '#/components/icons/ArrowOut
import {shareUrl} from 'lib/sharing'
import {HITSLOP_10} from 'lib/constants'
import {isNative} from 'platform/detection'
import {useInitialNumToRender} from 'lib/hooks/useInitialNumToRender'
const renderItem = ({item}: ListRenderItemInfo<PostView>) => {
return <Post post={item} />
@ -37,6 +38,7 @@ export default function HashtagScreen({
const {tag, author} = route.params
const setMinimalShellMode = useSetMinimalShellMode()
const {_} = useLingui()
const initialNumToRender = useInitialNumToRender()
const [isPTR, setIsPTR] = React.useState(false)
const fullTag = React.useMemo(() => {
@ -154,6 +156,8 @@ export default function HashtagScreen({
onRetry={fetchNextPage}
/>
}
initialNumToRender={initialNumToRender}
windowSize={11}
/>
)}
</>