memoize FlatList_INTERNAL
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import {forwardRef} from 'react'
|
import {forwardRef, memo} from 'react'
|
||||||
import {type FlatListComponent} from 'react-native'
|
import {type FlatListComponent, View, type ViewProps} from 'react-native'
|
||||||
import {View, type ViewProps} from 'react-native'
|
|
||||||
import Animated from 'react-native-reanimated'
|
import Animated from 'react-native-reanimated'
|
||||||
import {type FlatListPropsWithLayout} from 'react-native-reanimated'
|
import {type FlatListPropsWithLayout} from 'react-native-reanimated'
|
||||||
|
|
||||||
@@ -10,7 +9,7 @@ import {type FlatListPropsWithLayout} from 'react-native-reanimated'
|
|||||||
* Avoid using `FlatList_INTERNAL` and use `List` where possible.
|
* Avoid using `FlatList_INTERNAL` and use `List` where possible.
|
||||||
* The types are a bit wrong on `FlatList_INTERNAL`
|
* The types are a bit wrong on `FlatList_INTERNAL`
|
||||||
*/
|
*/
|
||||||
export const FlatList_INTERNAL = Animated.FlatList
|
export const FlatList_INTERNAL = memo(Animated.FlatList)
|
||||||
export type FlatList_INTERNAL<ItemT = any> = Omit<
|
export type FlatList_INTERNAL<ItemT = any> = Omit<
|
||||||
FlatListComponent<ItemT, FlatListPropsWithLayout<ItemT>>,
|
FlatListComponent<ItemT, FlatListPropsWithLayout<ItemT>>,
|
||||||
'CellRendererComponent'
|
'CellRendererComponent'
|
||||||
|
|||||||
Reference in New Issue
Block a user