forEach
void
forEach(
- ReactElement child,
- int index
Iterates over children, calling fn for each child.
Unlike map, forEach does not return anything.
Example:
Children.forEach(props['children'], (child, index) {
print('Child $index: ${child.type}');
});
Implementation
static void forEach(
JSAny? children,
void Function(ReactElement child, int index) fn,
) {
void jsIterator(JSObject child, JSNumber index) =>
fn(ReactElement.fromJS(child), index.toDartInt);
_childrenForEach(children, jsIterator.toJS);
}