From 9cd366714197809ebb5356b9cdb46c9417372b25 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Wed, 19 Sep 2018 09:48:57 -0700 Subject: [PATCH] Corrected misleading wording about React.Children.map --- content/docs/reference-react.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/docs/reference-react.md b/content/docs/reference-react.md index b9792f21..53f2e1af 100644 --- a/content/docs/reference-react.md +++ b/content/docs/reference-react.md @@ -162,7 +162,11 @@ Verifies the object is a React element. Returns `true` or `false`. React.Children.map(children, function[(thisArg)]) ``` -Invokes a function on every immediate child contained within `children` with `this` set to `thisArg`. If `children` is a keyed fragment or array it will be traversed: the function will never be passed the container objects. If children is `null` or `undefined`, returns `null` or `undefined` rather than an array. +Invokes a function on every immediate child contained within `children` with `this` set to `thisArg`. If `children` is an array it will be traversed and the function will be called for each child in the array. If children is `null` or `undefined`, this method will return `null` or `undefined` rather than an array. + +> Note +> +> If `children` is a `Fragment` it will be treated as a single child and not traversed. #### `React.Children.forEach`