@base-ui/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
13 lines • 398 B
JavaScript
import * as React from 'react';
export function isRenderableNode(node) {
if (node == null || typeof node === 'boolean' || node === '') {
return false;
}
if (Array.isArray(node)) {
return node.some(isRenderableNode);
}
return true;
}
export function hasRenderableChildren(element) {
return /*#__PURE__*/React.isValidElement(element) && isRenderableNode(element.props.children);
}