title: using Generics between props for a react component
body: <p>I'm trying to type the following component:</p>
  
  <pre><code>type Props&lt;Data&gt; = {
    data: Data[]
    render: ({ value }: { value: Data }) =&gt; React.ReactElement
  }
  
  const List: React.FC&lt;Props&gt; = ({data, render}) =&gt; {…}
  </code></pre>
  
  <p>The problem I'm having is that I want <code>Data</code> to be generic, whatever you pass in within an array I want to strongly type the render to know <code>value</code> as type <code>Data</code>. The problem is I'm not sure how to use this. Ideally I want to do the following:</p>
  
  <pre><code>&lt;List data={[1,2,3]} render={(value) =&gt; &lt;div&gt;{value + 2}&lt;/div&gt;}/&gt;
  </code></pre>
  
  <p>and be done, in this case render would know that <code>value</code> is a number. Is this possible?</p>