* Don't show "context" for classes without either contextType or contextTypes
* For classes with contextTypes, change the label to "legacy context" instead

---
Originally reported by @gaearon via https://github.com/bvaughn/react-devtools-experimental/issues/368
let displayName = null;
  let key = null;
  
  if (internalInstance._currentElement != null) {
    if (internalInstance._currentElement.key) {
      key = '' + internalInstance._currentElement.key;
    }
    const elementType = internalInstance._currentElement.type;
    if (typeof elementType === 'string') {
      displayName = elementType;
    } else if (typeof elementType === 'function') {
      displayName = getDisplayName(elementType);
    }
  }
  return {
    displayName,
    key,
  };
}
function getElementType(internalInstance: InternalInstance): ElementType {