Skip to content

Commit 121af31

Browse files
authored
Update inaccurate mapChildren comment (#18931)
The function you provide will only be passed a child and an index. It will not be passed a key. This is confirmed in the source, the Flow types, and the jsdoc comments.
1 parent 21dc41c commit 121af31

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react/src/ReactChildren.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ type MapFunc = (child: ?React$Node) => ?ReactNodeList;
212212
*
213213
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
214214
*
215-
* The provided mapFunction(child, key, index) will be called for each
215+
* The provided mapFunction(child, index) will be called for each
216216
* leaf child.
217217
*
218218
* @param {?*} children Children tree container.

0 commit comments

Comments
 (0)