react-native-collapsible icon indicating copy to clipboard operation
react-native-collapsible copied to clipboard

Warning: Each child in a list should have a unique "key" prop

Open Jinentonik opened this issue 5 years ago • 2 comments

I am receiving this warning when my app is rendered. All of the accordion function works fine.

How do i add key to each child inside accordion?

Jinentonik avatar Aug 17 '20 14:08 Jinentonik

If you are trying to render dinamically the children inside the accordion, each one should have its own key, if the child does not have a unique id to set as key to the parent, you can combine the accordion section index with the child index, you must pass to the child parent view

<Child key={childObj.id.toString()} /> or <Child key={${sectionIndex.toString()}_${childIndex.toString()}} />

PauloMello99 avatar Sep 29 '20 13:09 PauloMello99

same here!

wahidshadab avatar Jun 23 '22 04:06 wahidshadab