function map(children, func) {
  var index = 0;
  return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children.map(children, function (child) {
    return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.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.