From 5306e9229c27550214e336b93dcdb2bc3575dbf3 Mon Sep 17 00:00:00 2001 From: Aravind M Nair Date: Thu, 30 Jul 2026 03:38:24 -0700 Subject: [PATCH] Add missing `ListItemComponent` prop to VirtualizedList/FlatList/SectionList TypeScript types (#57754) Summary: `ListItemComponent` is a valid prop on `FlatList`, `SectionList` and `VirtualizedList` (it's in the Flow types in `VirtualizedListProps.js`), but it's missing from the `.d.ts`, so TypeScript errors on it even though it works at runtime. Added it to `VirtualizedListWithoutRenderItemProps` next to the other `List*Component` props, so all three inherit it. ## Changelog: [GENERAL] [ADDED] - Add missing ListItemComponent type to VirtualizedList props Pull Request resolved: https://github.com/react/react-native/pull/57754 Test Plan: Errors on `main`, type-checks with the change: ```tsx ``` Type-only, addition only, no runtime changes. Reviewed By: Abbondanzo Differential Revision: D114061127 Pulled By: fabriziocucci fbshipit-source-id: e843645a93b2320370829e8fd86deda078d6852a --- packages/virtualized-lists/Lists/VirtualizedList.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/virtualized-lists/Lists/VirtualizedList.d.ts b/packages/virtualized-lists/Lists/VirtualizedList.d.ts index 87ef2ba8e08..85c1c9f258f 100644 --- a/packages/virtualized-lists/Lists/VirtualizedList.d.ts +++ b/packages/virtualized-lists/Lists/VirtualizedList.d.ts @@ -188,6 +188,14 @@ export interface VirtualizedListWithoutRenderItemProps< */ ListHeaderComponentStyle?: StyleProp | undefined; + /** + * Each data item is rendered using this element, as an alternative to `renderItem`. + * Can be a React Component Class or a render function. In addition to the data provided + * to `renderItem`, this receives `index` and `separators` metadata. + */ + ListItemComponent?: + React.ComponentType | React.ReactElement | null | undefined; + /** * The default accessor functions assume this is an Array<{key: string}> but you can override * getItem, getItemCount, and keyExtractor to handle any type of index-based data.