PromoCursed/node_modules/antd/lib/form/hooks/useChildren.js
2024-08-20 23:25:37 +04:00

15 lines
496 B
JavaScript

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = useChildren;
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
function useChildren(children) {
if (typeof children === 'function') {
return children;
}
const childList = (0, _toArray.default)(children);
return childList.length <= 1 ? childList[0] : childList;
}