UNPKG

react-form-with-constraints

Version:
15 lines (14 loc) 489 B
"use strict"; 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;