Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame contribute delete
378 Bytes
import toArray from 'rc-util/lib/Children/toArray';
import type { FormItemProps } from '../FormItem';
export default function useChildren(
children?: FormItemProps['children'],
): FormItemProps['children'] {
if (typeof children === 'function') {
return children;
}
const childList = toArray(children);
return childList.length <= 1 ? childList[0] : childList;
}