@samitouri / QOS-React-2 / commits / 121af3143c

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.

Ricky Vetter committed May 15, 2020 at 13:05 UTC 121af3143c7164a196420b080cb31d0ef07d5dff
1 file changed +1 -1
packages/react/src/ReactChildren.js
+1 -1
@@ -212,7 +212,7 @@ type MapFunc = (child: ?React$Node) => ?ReactNodeList;
212 *
213 * See https://reactjs.org/docs/react-api.html#reactchildrenmap
214 *
215 - * The provided mapFunction(child, key, index) will be called for each
215 + * The provided mapFunction(child, index) will be called for each
216 * leaf child.
217 *
218 * @param {?*} children Children tree container.