memoize FlatList_INTERNAL

This commit is contained in:
Samuel Newman
2026-01-26 14:05:29 +02:00
parent 2ad84d7dfc
commit 250e06c96e
+3 -4
View File
@@ -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'