I'm getting the common error: Warning: Each child in an array or iterator should have a unique "key" prop.
In general, finding the offending code is easy, but this time it is not. What I would like to know is what are the key values for the items being displayed.
(Q) Is there a way for me to see what each key property's value in the DOM that is rendered?
When I inspect the HTML generated lists that react has rendered, I don't see the key property on the DOM elements (nor would I expect to see it), but that is what I'm asking to see. Is there a flag I can set to ask React to add that key property value to the DOM so I can see it?
This would let me see where I'm missing a key, or have two keys with the same value (this is the problem I think I have). See Find Duplicated Key in a complicated React component
At this point, I'm doing the methodical approach of rendering one item at a time to isolate which item has the problem so I can zero in and find the offending code.
Searching for solutions
When searching for solutions there are several good write ups on how this works and why keys are needed, and they are shown below.
Similar question (OKs same question as mine, but no answer) - Cant find react error which child is missing key prop
Excellent question about how keys work and a great answer. See Understanding unique keys for array children in React.js
The ReactJS docs on using Keys and mis-using them. See https://reactjs.org/docs/lists-and-keys.html#extracting-components-with-keys.
An npm library that helps solve this problem. See https://www.npmjs.com/package/react-key-index
How do you track down duplicate keys - Find Duplicated Key in a complicated React component