UNPKG

489 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.deepForEach = void 0;
4const react_1 = require("react");
5function deepForEach(children, fn) {
6 react_1.Children.forEach(children, child => {
7 const element = child;
8 if (element.props && element.props.children && typeof element.props.children === 'object') {
9 deepForEach(element.props.children, fn);
10 }
11 fn(element);
12 });
13}
14exports.deepForEach = deepForEach;