mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import React from 'react'
2import {Dimensions} from 'react-native'
3
4const MIN_POST_HEIGHT = 100
5
6export function useInitialNumToRender(minItemHeight: number = MIN_POST_HEIGHT) {
7 return React.useMemo(() => {
8 const screenHeight = Dimensions.get('window').height
9 return Math.ceil(screenHeight / minItemHeight) + 1
10 }, [minItemHeight])
11}