Skip to content

Document ListItemComponent prop on the FlatList page - #5198

Open
aravi365 wants to merge 1 commit into
react:mainfrom
aravi365:docs-flatlist-listitemcomponent
Open

Document ListItemComponent prop on the FlatList page#5198
aravi365 wants to merge 1 commit into
react:mainfrom
aravi365:docs-flatlist-listitemcomponent

Conversation

@aravi365

Copy link
Copy Markdown

The FlatList page documents every inherited List*Component prop (ListEmptyComponent, ListFooterComponent, ListHeaderComponent, ItemSeparatorComponent) except ListItemComponent, so it looks like the prop does not exist on FlatList.

It does. FlatList._renderer renders <ListItemComponent {...props} /> and falls back to renderItem only when it is not set, so it also takes precedence when both are passed:

https://github.com/react/react-native/blob/main/packages/react-native/Libraries/Lists/FlatList.js#L624

It is already documented on the VirtualizedList page. This adds the same entry to FlatList, in alphabetical position next to the other List*Component props, and notes the precedence behaviour.

Type is listed as component, element to match the prop's type and the neighbouring entries on the same page.

FlatList supports ListItemComponent (it takes precedence over renderItem),
and it is documented on the VirtualizedList page, but the FlatList page
lists every other inherited List*Component prop except this one.
@meta-cla meta-cla Bot added the CLA Signed label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant