instantiateComponent = (component, props) => {
  if (!component) {
    return null;
  } else if (typeof component === 'string') {
    const Component = Components[component];
    return <Component {...props} />;
  } else if (React.isValidElement(component)) {
    return React.cloneElement(component, props);
  } else if (typeof component === 'function' &&
    component.prototype &&
    component.prototype.isReactComponent
  ) {
    const Component = component;
    return <Component {...props} />;
  } else if (typeof component === 'function') {
    return component(props);
  } else if (typeof component === 'object' && component.$$typeof && component.render) {
    const Component = component;
    return <Component {...props} />;
  } else {
    return component;
  }
}
Returns an instance of the given component name of function
@param {string|function} component  A component, the name of a component, or a react element
@param {Object} [props]  Optional properties to pass to the component