MCPcopy Create free account
hub / github.com/microsoft/SandDance / flattenChildren

Function flattenChildren

docs/external/js/react-dom.development.js:2188–2205  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

2186 var didWarnInvalidChild = false;
2187
2188 function flattenChildren(children) {
2189 var content = ''; // Flatten children. We'll warn if they are invalid
2190 // during validateProps() which runs for hydration too.
2191 // Note that this would throw on non-element objects.
2192 // Elements are stringified (which is normally irrelevant
2193 // but matters for <fbt>).
2194
2195 React.Children.forEach(children, function (child) {
2196 if (child == null) {
2197 return;
2198 }
2199
2200 content += child; // Note: we don't warn about invalid children here.
2201 // Instead, this is done separately below so that
2202 // it happens during the hydration codepath too.
2203 });
2204 return content;
2205 }
2206 /**
2207 * Implements an <option> host component that warns when `selected` is set.
2208 */

Callers 1

getHostProps$1Function · 0.85

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected