title: TypeScript React Native Flatlist: How to give renderItem the correct type of it's item?
body: <p>I'm building a React Native app with TypeScript. <code>renderItem</code> complains that the destructured item implicitly has an <code>any</code> type. I googled and found <a href="https://stackoverflow.com/questions/50743606/how-to-use-generic-component-in-react-native-with-typescript">this question</a> and tried to implement what they teach here combined with the types in <code>index.d.ts</code> of the <code>@types</code> package for React Native.</p>
  
  <pre><code>export interface Props {
    emotions: Emotion[];
  }
  
  class EmotionsPicker extends PureComponent&lt;Props&gt; {
    keyExtractor = (item, index) =&gt; index;
    renderItem = ({ item }) =&gt; (
      &lt;ListItem title={item.name} checkmark={item.checked} /&gt;
    );
  
    render() {
      return (
        &lt;FlatList&lt;Emotion&gt;
          keyExtractor={this.keyExtractor}
          renderItem={this.renderItem}
          data={this.props.emotions}
        /&gt;
      );
    }
  }
  </code></pre>
  
  <p>Unfortunately this does not work. How can I give item the type <code>Emotion</code>?</p>