* 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
} from 'react-devtools-shared/src/backend/types';
import type {
  DehydratedData,
  Element,
  InspectedElement as InspectedElementFrontend,
} from 'react-devtools-shared/src/devtools/views/Components/types';
import type {Resource, Thenable} from '../../cache';
export type GetInspectedElementPath = (
  id: number,
  path: Array<string | number>,
) => void;
export type GetInspectedElement = (
  id: number,
) => InspectedElementFrontend | null;
type Context = {|
  getInspectedElementPath: GetInspectedElementPath,
  getInspectedElement: GetInspectedElement,
|};
const InspectedElementContext = createContext<Context>(((null: any): Context));
InspectedElementContext.displayName = 'InspectedElementContext';
type ResolveFn = (inspectedElement: InspectedElementFrontend) => void;
type InProgressRequest = {|
  promise: Thenable<InspectedElementFrontend>,
  resolveFn: ResolveFn,
|};
const inProgressRequests: WeakMap<Element, InProgressRequest> = new WeakMap();
const resource: Resource<
  Element,
  Element,
  InspectedElementFrontend,