mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user