Find Duplicated Key in a complicated React component

Viewed 6274

I have a react component, which generate many keys for a time, I am not sure which one is not unique. The error is as below. Any easy way to help debugging? thanks!

react.js:19500 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of MyGrid. See https ://fb.me/ react-warning-keys for more information.

2 Answers

Click to expand the error in the console to reveal the stack trace. Follow the calls up to the one before createElementWithValidation and it should show you the culprit line number.

Log the keys you're using there. If there's a ton, put them in an array and [].filter((e, i, a) => a.indexOf(e) !== i)

Related