code: function forEach(children, func) {
    let index = 0;
    React.Children.forEach(children, child => {
      if (React.isValidElement(child)) func(child, index++);
    });
  }
docs: 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".