function toArray(children) {
    return mapChildren(children, function (child) {
      return child;
    }) || [];
  }
Flatten a children object (typically specified as `props.children`) and
return an array with appropriately re-keyed children.

See https://reactjs.org/docs/react-api.html#reactchildrentoarray