src/utils/ElementChildren.js
function map(children, func) {
  let index = 0;

  return React.Children.map(children, child =>
    React.isValidElement(child) ? func(child, index++) : child,
  );
}
function map(children, func) {
  let index = 0;

  return React.Children.map(children, child =>
    React.isValidElement(child) ? func(child, index++) : child,
  );
}
function map ( children , func ) { let index = 0 ; return React . Children . map ( children , child => React . isValidElement ( child ) ? func ( child , index ++ ) : child , ) ; }
Iterates through children that are typically specified as `props.children`,
but only maps over children that are "valid elements".

The mapFunction provided index will be normalised to the components mapped,
so an invalid component would not increase the index.
Iterates through children that are typically specified as props . children but only maps over children that are valid elements .