ReactNative SectionList Missing Key Warning

I follow the ReactNative sections guide ( https://facebook.imtqy.com/react-native/docs/using-a-listview.html#content ) and run a warning message.

Alert Status

"Warning: VirtualizedSectionList: A sectionthat you specified is missing a property key.

"VirtualizedList: missing keys for items, remember to specify a key property for each item or provide a custom keyExtractor"

Can someone help resolve this warning?

Edit Therefore, I was able to resolve the first warning by adding a key to the sections

sections={[
            {key: 'D', title: 'D', data: ['Devin']},
            {key: 'J', title: 'J', data: ['Jackson', 'James', 'Jillian',   'Jimmy', 'Joel', 'John', 'Julie']},
          ]}

But I am losing the second error for 1 instance.

+4
2

- , - , . , //. :

data: [{ key: //add a unique key here or use keyExtractor, name: 'Devin' }, ...]
0

Source: https://habr.com/ru/post/1680160/


All Articles