Skip to content

Commit

Permalink
Update inaccurate mapChildren comment (#18931)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rickyvetter committed May 15, 2020
1 parent 21dc41c commit 121af31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/ReactChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ type MapFunc = (child: ?React$Node) => ?ReactNodeList;
*
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
*
* The provided mapFunction(child, key, index) will be called for each
* The provided mapFunction(child, index) will be called for each
* leaf child.
*
* @param {?*} children Children tree container.
Expand Down

0 comments on commit 121af31

Please sign in to comment.