Skip to content

Commit

Permalink
Solving FlatList keyExtractor Error
Browse files Browse the repository at this point in the history
This changement solve 
Error:
Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type `number` supplied to `CellRenderer`, expected `string`.
  • Loading branch information
vbranco committed Jun 6, 2021
1 parent 4cecb72 commit 6e47a75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/react-native-multi-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export default class MultiSelect extends Component {
<FlatList
data={renderItems}
extraData={selectedItems}
keyExtractor={item => item[uniqueKey]}
keyExtractor={(item, index) => index.toString()}
listKey={item => item[uniqueKey]}
renderItem={rowData => this._getRow(rowData.item)}
{...flatListProps}
Expand Down

0 comments on commit 6e47a75

Please sign in to comment.