diff --git a/Libraries/Lists/FlatList.js b/Libraries/Lists/FlatList.js index 8dea8fc8712be0..c5f843a28c5c68 100644 --- a/Libraries/Lists/FlatList.js +++ b/Libraries/Lists/FlatList.js @@ -631,9 +631,10 @@ class FlatList extends React.PureComponent, void> { }; const element = renderer({ - item: {...it, accessibilityCollectionItem}, + item: it, index: index * numColumns + kk, separators: info.separators, + accessibilityCollectionItem, }); return element != null ? ( @@ -651,7 +652,7 @@ class FlatList extends React.PureComponent, void> { return renderer({ ...info, - item: {...info.item, accessibilityCollectionItem}, + accessibilityCollectionItem, }); } }, @@ -661,7 +662,7 @@ class FlatList extends React.PureComponent, void> { _getAccessibilityCollection = () => { const accessibilityCollectionProps = { itemCount: this.props.data ? this.props.data.length : 0, - //$FlowFixMe[incompatible-call] see https://bit.ly/3viYSh8 + //$FlowFixMe[incompatible-call] see https://bit.ly/3MJiZLL rowCount: this._getItemCount(this.props.data), columnCount: numColumnsOrDefault(this.props.numColumns), hierarchical: false, @@ -702,7 +703,6 @@ class FlatList extends React.PureComponent, void> { const styles = StyleSheet.create({ row: {flexDirection: 'row'}, - cellStyle: {flex: 1}, }); module.exports = FlatList; diff --git a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js index 613c7f1321b11a..63b235d12e6eb1 100644 --- a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js +++ b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js @@ -280,7 +280,7 @@ class FlatListExample extends React.PureComponent { return ( ) => { + _renderItemComponent = ({item, accessibilityCollectionItem}) => { return ( ( - - {title} +const Item = ({item, accessibilityCollectionItem}) => ( + + {item.title} ); -const renderItem = ({ item }) => ; +const renderItem = (props) => ; -const renderFlatList = ({ item }) => ( - - Flatlist {item} - - -); +const renderFlatList = ({item}) => { + return ( + + Flatlist {item} + + + ); +}; const FlatListNested = () => { return (