src/utils/ElementChildren.js
function forEach(children, func) {
  let index = 0;
  React.Children.forEach(children, child => {
    if (React.isValidElement(child)) func(child, index++);
  });
}
function forEach(children, func) {
  let index = 0;
  React.Children.forEach(children, child => {
    if (React.isValidElement(child)) func(child, index++);
  });
}
function forEach ( children , func ) { let index = 0 ; React . Children . forEach ( children , child => { if ( React . isValidElement ( child ) ) func ( child , index ++ ) ; } ) ; }
Iterates through children that are "valid elements".

The provided forEachFunc(child, index) will be called for each
leaf child with the index reflecting the position relative to "valid components".
Iterates through children that are valid elements .