Skip to content

Add missing ListItemComponent prop to VirtualizedList/FlatList/SectionList TypeScript types - #57754

Open
aravi365 wants to merge 1 commit into
react:mainfrom
aravi365:add-listitemcomponent-type
Open

Add missing ListItemComponent prop to VirtualizedList/FlatList/SectionList TypeScript types#57754
aravi365 wants to merge 1 commit into
react:mainfrom
aravi365:add-listitemcomponent-type

Conversation

@aravi365

@aravi365 aravi365 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

Test Plan

Errors on main, type-checks with the change:

<FlatList data={[]} ListItemComponent={MyItem} />

Type-only, addition only, no runtime changes.

ListItemComponent is a documented, public prop of VirtualizedList (and
thus FlatList and SectionList) in the Flow source, but was missing from
the hand-written TypeScript definitions, causing a type error when used.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 29, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 29, 2026
@meta-codesync

meta-codesync Bot commented Jul 29, 2026

Copy link
Copy Markdown

@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D114061127.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant