title: How do you extract a specific TypeScript prop type from a React component?
body: <p>I'm creating my own Image component and want to reuse React's image component <code>ImageSourcePropType</code> for my source/previewSource props.</p>
  
  <p>Here's the component.</p>
  
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  import { Image, ImageBackground } from 'react-native';
  
  type ImageSourceProp = React.ComponentProps&lt;typeof Image&gt;.ImageSourcePropType; // HOW?
  
  interface CachedImageProps {
    source: ImageSourceProp;
    previewSource: ImageSourceProp;
  }
  
  const CachedImage: React.FC&lt;CachedImageProps&gt; = ({ source, previewSource, ...remainingProps }) =&gt; {
    // console.log('TRIGGERED CachedImage')
  
    return (
      &lt;ImageBackground source={previewSource|| source} fadeDuration={0} {...remainingProps}&gt;
        &lt;Image source={cachedSource} fadeDuration={0} {...remainingProps} /&gt;
      &lt;/ImageBackground&gt;
    );
  };
  
  export default CachedImage;
  
  </code></pre>
  
  <p>How do I get the <code>ImageSourcePropType</code>?</p>