UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

13 lines (12 loc) 492 B
"use client"; import { isElement } from "../is-element/is-element.mjs"; import { Children } from "react"; //#region packages/@mantine/core/src/core/utils/get-single-element-child/get-single-element-child.ts function getSingleElementChild(children) { const _children = Children.toArray(children); if (_children.length !== 1 || !isElement(_children[0])) return null; return _children[0]; } //#endregion export { getSingleElementChild }; //# sourceMappingURL=get-single-element-child.mjs.map