* Count the number of children that are typically specified as * `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrencount * * @param {?*} children Children tree container. * @return {number} The number of children.
(children: ?ReactNodeList)
| 381 | * @return {number} The number of children. |
| 382 | */ |
| 383 | function countChildren(children: ?ReactNodeList): number { |
| 384 | let n = 0; |
| 385 | mapChildren(children, () => { |
| 386 | n++; |
| 387 | // Don't return anything |
| 388 | }); |
| 389 | return n; |
| 390 | } |
| 391 | |
| 392 | type ForEachFunc = (child: ?React$Node) => void; |
| 393 |
nothing calls this directly
no test coverage detected