Skip to content

Commit 9253c10

Browse files
📖 Adds warning cases to rule documentation
1 parent cb425c3 commit 9253c10

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎docs/rules/no-array-index-key.md

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ things.reduce((collection, thing, index) => (
5050
things.reduceRight((collection, thing, index) => (
5151
collection.concat(<Hello key={index} />)
5252
), []);
53+
54+
React.Children.map(this.props.children, (child, index) => (
55+
React.cloneElement(child, { key: index })
56+
))
57+
58+
Children.forEach(this.props.children, (child, index) => (
59+
React.cloneElement(child, { key: index })
60+
))
5361
```
5462

5563
The following patterns are **not** considered warnings:

0 commit comments

Comments
 (0)