-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Hi! This currently does not flag an error with no-array-index-key:
React.Children.map(this.props.children, (child, index) => {
const className = classnames(
child.props.className,
`${this.props.transition}-finished`
);
return React.cloneElement(child, { key: index, className });
});Specifically, I would expect the key: index part to trigger the no-array-index-key warning.
(I realize that there is probably a better way to write this (ie: not using cloneElement), but I noticed this recently and saw that it didn't flag the warning.
PS: Thanks for the awesome ESLint plugin! 🎉 Can't wait for the next release!
