Skip to content

Commit

Permalink
fix: fix FlatList viewabilityConfig prop type (#37299)
Browse files Browse the repository at this point in the history
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: #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
  • Loading branch information
jeongshin authored and facebook-github-bot committed May 9, 2023
1 parent e540d05 commit 5dfa38a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-native/Libraries/Lists/FlatList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -144,7 +145,7 @@ export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
/**
* 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.
Expand Down

0 comments on commit 5dfa38a

Please sign in to comment.