* Returns the first child in a collection of children and verifies that there * is only one child in the collection. * * See https://reactjs.org/docs/react-api.html#reactchildrenonly * * The current implementation of this function assumes that a single child gets * passed without a wrapp
(children)
| 1638 | |
| 1639 | |
| 1640 | function onlyChild(children) { |
| 1641 | if (!isValidElement(children)) { |
| 1642 | { |
| 1643 | throw Error( "React.Children.only expected to receive a single React element child." ); |
| 1644 | } |
| 1645 | } |
| 1646 | |
| 1647 | return children; |
| 1648 | } |
| 1649 | |
| 1650 | function createContext(defaultValue, calculateChangedBits) { |
| 1651 | if (calculateChangedBits === undefined) { |
nothing calls this directly
no test coverage detected