* 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
(children)
| 1215 | |
| 1216 | |
| 1217 | function onlyChild(children) { |
| 1218 | if (!isValidElement(children)) { |
| 1219 | throw new Error('React.Children.only expected to receive a single React element child.'); |
| 1220 | } |
| 1221 | |
| 1222 | return children; |
| 1223 | } |
| 1224 | |
| 1225 | function createContext(defaultValue) { |
| 1226 | // TODO: Second argument used to be an optional `calculateChangedBits` |
nothing calls this directly
no test coverage detected
searching dependent graphs…