MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / onlyChild

Function onlyChild

bundle.js:2260–2263  ·  view source on GitHub ↗

* Returns the first child in a collection of children and verifies that there * is only one child in the collection. * * See https://facebook.github.io/react/docs/react-api.html#react.children.only * * The current implementation of this function assumes that a single child g

(children)

Source from the content-addressed store, hash-verified

2258 * structure.
2259 */
2260 function onlyChild(children) {
2261 !ReactElement_1.isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
2262 return children;
2263 }
2264
2265 var onlyChild_1 = onlyChild;
2266

Callers

nothing calls this directly

Calls 1

invariantFunction · 0.70

Tested by

no test coverage detected