MCPcopy
hub / github.com/facebook/react / forEachChildren

Function forEachChildren

packages/react/src/ReactChildren.js:406–420  ·  view source on GitHub ↗

* Iterates through children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrenforeach * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {func

(
  children: ?ReactNodeList,
  forEachFunc: ForEachFunc,
  forEachContext: mixed,
)

Source from the content-addressed store, hash-verified

404 * @param {*} forEachContext Context for forEachContext.
405 */
406function forEachChildren(
407 children: ?ReactNodeList,
408 forEachFunc: ForEachFunc,
409 forEachContext: mixed,
410): void {
411 mapChildren(
412 children,
413 // $FlowFixMe[missing-this-annot]
414 function () {
415 forEachFunc.apply(this, arguments);
416 // Don't return anything.
417 },
418 forEachContext,
419 );
420}
421
422/**
423 * Flatten a children object (typically specified as `props.children`) and

Callers

nothing calls this directly

Calls 2

mapChildrenFunction · 0.85
applyMethod · 0.45

Tested by

no test coverage detected