react-form-with-constraints
Version:
Simple form validation for React
15 lines (14 loc) • 489 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.deepForEach = void 0;
const react_1 = require("react");
function deepForEach(children, fn) {
react_1.Children.forEach(children, child => {
const element = child;
if (element.props && element.props.children && typeof element.props.children === 'object') {
deepForEach(element.props.children, fn);
}
fn(element);
});
}
exports.deepForEach = deepForEach;