Add more detail to missing-key warning
See original GitHub issueI have a component in which I must be using an array and not setting keys because I get this warning:
Warning: Each child in an array or iterator should have a unique "key" prop.
Check the render method of `Blah`.
See https://fb.me/react-warning-keys for more information.
The problem is that render methods aren’t always simple and sometimes it’s quite hard to find out where the problematic array is.
It would be awesome it the warning could be enhanced to provide some more information about the problematic dom. Something like:
Warning: Each child in an array or iterator should have a unique "key" prop.
Check the render method of `Blah` when rendering: <ol><li>One</li><li>Two</li></ol>
See https://fb.me/react-warning-keys for more information.
or even
Warning: Each child in an array or iterator should have a unique "key" prop.
Check the render method of `Blah`.
The head element renders to: <li>One</li>
See https://fb.me/react-warning-keys for more information.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
reactjs - Can't find missing key in 'Each child in a list should ...
I've been starring at my code, but I can't see where the key is missing. That is my error: Warning: Each child in...
Read more >Resolve Missing Key Issues - VMware Docs
If the keys are missing only on the ESXi host, vCenter Server generates a virtual machine alarm and the following message appears in...
Read more >Missing keys & unexpected keys in state_dict when loading ...
After that I would like to infer some images using my model, it fails with the follow error: RuntimeError: Error(s) in loading state_dict...
Read more >react_missing_key_prop - Rule | DeepScan
If key prop is missing in each React element when recursing on children of a DOM ... Also in this case, React will...
Read more >How to Fix 'Each child should have a unique key prop' - Webtips
Learn what is the root cause, and how to fix 'Warning: Each child in a list should have a unique 'key' prop.' warnings...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This was fixed in https://github.com/facebook/react/pull/6799—now we have an exact stack trace.
Cool, that would be helpful info.