From 5dfa38a20e72f6fe560577ec499ff2fee5943b73 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 9 May 2023 04:13:09 -0700 Subject: [PATCH] fix: fix FlatList viewabilityConfig prop type (#37299) Summary: FlatList `viewabilityConfig` prop seems no need to be any type. So I replaced it with `ViewabilityConfig` from `VirtualizedList.d.ts` ## Changelog: [GENERAL] [FIXED] - change FlatList `viewabilityConfig` prop type `any` to `ViewabilityConfig` Pull Request resolved: https://github.com/facebook/react-native/pull/37299 Test Plan: Ran yarn test-typescript and yarn test-typescript-offline with no errors. Reviewed By: jacdebug Differential Revision: D45689033 Pulled By: cipolleschi fbshipit-source-id: e7fd31c534c5f47321b36d0d764f466392ad897e --- packages/react-native/Libraries/Lists/FlatList.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Lists/FlatList.d.ts b/packages/react-native/Libraries/Lists/FlatList.d.ts index b6b28675a7c..5bbe2fa3b80 100644 --- a/packages/react-native/Libraries/Lists/FlatList.d.ts +++ b/packages/react-native/Libraries/Lists/FlatList.d.ts @@ -12,6 +12,7 @@ import type { ListRenderItem, ViewToken, VirtualizedListProps, + ViewabilityConfig, } from '@react-native/virtualized-lists'; import type {ScrollViewComponent} from '../Components/ScrollView/ScrollView'; import type {StyleProp} from '../StyleSheet/StyleSheet'; @@ -144,7 +145,7 @@ export interface FlatListProps extends VirtualizedListProps { /** * See `ViewabilityHelper` for flow type and further documentation. */ - viewabilityConfig?: any | undefined; + viewabilityConfig?: ViewabilityConfig | undefined; /** * Note: may have bugs (missing content) in some circumstances - use at your own risk.