@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
10 lines • 326 B
JavaScript
// used to determine if anything is gonna render
// falsy elements do not render,
// but child arrays are truthy even though their items are falsy
const hasTruthyChildren = children => {
if (Array.isArray(children)) {
return children.some(hasTruthyChildren);
}
return !!children;
};
export default hasTruthyChildren;