UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

8 lines 258 B
import { toArray } from '@rc-component/util'; export default function useChildren(children) { if (typeof children === 'function') { return children; } const childList = toArray(children); return childList.length <= 1 ? childList[0] : childList; }