Q:

React Native keyExtractor fails to function properly in SectionList

Below is the keyExtractor method I'm using. This method worked fine when the component was a FlatList, but I keep getting the following message after I converted the FlatList to a SectionList.
"Warning: VirtualizedSectionList: A section you supplied is missing the key property."
// defining the keyExtractor function

_keyExtractor = (item, index) => {
    console.log('id in key extractor', item.id)
    return item.id;
  }

// during render

<SectionList
   ...
   keyExtractor={this._keyExtractor}
   ...
/>

I'm logging the item.id and it's printing out distinct ids correctly. Any thoughts? Thanks in advance.

A:

You might go through this link. The warning is shown because each section needs a item key. For eg:-
sections={[ {key: 'D', title:'D' data: ['Devin']}, {key: 'J', title: 'J', data: ['Jackson', 'James', 'Jillian', 'Jimmy', 'Joel', 'John', 'Julie']}, ]}

