getName = (component) => {
  if (component && component._currentElement && component._currentElement.type) {
    if (component._currentElement.type.displayName) return component._currentElement.type.displayName;
    else if (component._currentElement.type.name) return component._currentElement.type.name;
    return component._currentElement.type;
  }
  return 'default';
}
Returns a React component's name, if any
@param {React Element} component