1
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user