title: React: Check if JSX Element is derived from a particular class
body: <p>I'm using TypeScript, and want to check whether a <code>JSX.Element</code> instance is a sub class of another React component.</p>
  
  <p>For example, if I have a <code>Vehicle</code> component, and a <code>Car</code> component that extends it, then given a <code>JSX.Element</code> created from a <code>Car</code> component, I want to know if its React component class is derived from a certain one.</p>
  
  <p>e.g.</p>
  
  <pre><code>isDerivedFrom(jsx, Car) // Should return true
  isDevivedFrom(jsx, Vehicle) // Should also return true
  </code></pre>
  
  <p>I noticed that a <code>JSX.Element</code> exposes a <code>type</code> property which tells me the name of the React component, but doesn't tell me if it's derived from a certain component.</p>
  
  <p>How can I achieve this? </p>