mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
35f6ed1146
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53599 Runtime and types fix for the `ItemSeparatorComponent` prop on `virtualized-list` components (`FlatList`, `SectionList`, `VirtualizedList`). - Docs source, where this prop (adjacent to other `*Component` props) is documented as accepting elements: https://reactnative.dev/docs/virtualizedlist#itemseparatorcomponent. - Existing runtime behaviour matching this definition: https://github.com/facebook/react-native/blob/8d33e1c205b12fe27f4319e6566bb0c088197810/packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js#L197-L203 **Changes** - Update Flow, manual TS type defs. - Align runtime behaviour in `VirtualizedSectionList` to add matching `React.isValidElement()` behaviour. Resolves https://github.com/facebook/react-native/issues/53531. Changelog: [General][Fixed] - The `ItemSeparatorComponent` prop on list components now accepts a React element as well as a component function. Reviewed By: cortinico Differential Revision: D81675423 fbshipit-source-id: 3eed93b1bea89554988d6e20fa61b72e17be55df
@react-native/virtualized-lists
Installation
yarn add @react-native/virtualized-lists
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the React Native root folder:
yarnto install the dependencies. You just need to run this onceyarn jest packages/virtualized-lists.