@wordpress/components
Version:
UI components for WordPress.
12 lines (11 loc) • 324 B
JavaScript
import { Children, isValidElement } from "@wordpress/element";
function getValidChildren(children) {
if (typeof children === "string") {
return [children];
}
return Children.toArray(children).filter((child) => isValidElement(child));
}
export {
getValidChildren
};
//# sourceMappingURL=get-valid-children.js.map