Latest updates from IceHrmPro
This commit is contained in:
19
web/node_modules/rc-util/es/Children/toArray.js
generated
vendored
Normal file
19
web/node_modules/rc-util/es/Children/toArray.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
import { isFragment } from 'react-is';
|
||||
export default function toArray(children) {
|
||||
var ret = [];
|
||||
React.Children.forEach(children, function (child) {
|
||||
if (child === undefined || child === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Array.isArray(child)) {
|
||||
ret = ret.concat(toArray(child));
|
||||
} else if (isFragment(child) && child.props) {
|
||||
ret = ret.concat(toArray(child.props.children));
|
||||
} else {
|
||||
ret.push(child);
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user