From 121af3143c7164a196420b080cb31d0ef07d5dff Mon Sep 17 00:00:00 2001 From: Ricky Vetter Date: Fri, 15 May 2020 13:05:08 -0400 Subject: [PATCH] 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. --- packages/react/src/ReactChildren.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/ReactChildren.js b/packages/react/src/ReactChildren.js index 664c48302e..eb9ef5aca9 100644 --- a/packages/react/src/ReactChildren.js +++ b/packages/react/src/ReactChildren.js @@ -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.