Don't pass down onScroll (replacement TBD)

This commit is contained in:
Dan Abramov
2023-12-13 04:34:16 +00:00
parent b1cb4ef4de
commit 9e12ea5143
14 changed files with 33 additions and 128 deletions
+8 -1
View File
@@ -33,7 +33,14 @@ function ListImpl<ItemT>(
},
})
return <FlatList_INTERNAL {...props} onScroll={scrollHandler} ref={ref} />
return (
<FlatList_INTERNAL
{...props}
onScroll={scrollHandler}
scrollEventThrottle={1}
ref={ref}
/>
)
}
export const List = React.forwardRef(ListImpl) as <ItemT>(
+3 -2
View File
@@ -1,5 +1,7 @@
import React, {useEffect, useState} from 'react'
import {
NativeSyntheticEvent,
NativeScrollEvent,
Pressable,
RefreshControl,
StyleSheet,
@@ -7,7 +9,6 @@ import {
ScrollView,
} from 'react-native'
import {FlatList_INTERNAL} from './Views'
import {OnScrollCb} from 'lib/hooks/useOnMainScroll'
import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle'
import {Text} from './text/Text'
import {usePalette} from 'lib/hooks/usePalette'
@@ -38,7 +39,7 @@ export const ViewSelector = React.forwardRef<
| null
| undefined
onSelectView?: (viewIndex: number) => void
onScroll?: OnScrollCb
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void
onRefresh?: () => void
onEndReached?: (info: {distanceFromEnd: number}) => void
}