title: How to pass props in the component to FlatList renderItem
body: <p>I have a Function as a prop in my component and I have to pass this Function Prop to another Component in the renderItem in FlastList. How to do that? Here is my code.</p>
  
  <pre><code>import React, { Component } from 'react';
  import { View } from 'native-base';
  import PropTypes from 'prop-types';
  import { FlatList } from 'react-native';
  import AddPlayers from '../AddPlayers/AddPlayers';
  import League from '../League/League';
  export default class InviteLeagues extends Component {
    static propTypes = {
      invitedLeagues: PropTypes.Array,
      label: PropTypes.string.isRequired,
      InvitedLeaguesList: PropTypes.Array,
      onPress: PropTypes.func.isRequired
    };
  
    static defaultProps = {
      InvitedLeaguesList: [
        { name: 'Howdy', createdBy: 'email1@gamil.com', status: 'Join' },
        { name: 'Lorem', createdBy: 'email@gmail.com', status: 'Join' }
      ]
    };
  
    renderLeague(item) {
      return &lt;League invitedLeague={item} /&gt;;
    }
  
    render() {
      return (
        &lt;View {...this.props}&gt;
          &lt;AddPlayers
            label={this.props.label}
            labelStyle={{ fontStyle: 'italic' }}
          /&gt;
          &lt;FlatList
            numColumns={1}
            data={this.props.InvitedLeaguesList}
            renderItem={this.renderLeague}
          /&gt;
        &lt;/View&gt;
      );
    }
  }
  </code></pre>
  
  <p>Now I have to pass <code>onPress</code> (Function Prop) to <code>League</code> Component</p>
  
  <p>I tried like this</p>
  
  <pre><code> &lt;FlatList
            numColumns={1}
            data={this.props.InvitedLeaguesList}
            renderItem={this.renderLeague}
            extraData={this.props}
          /&gt;
  
  renderLeague(item) {
      return &lt;League invitedLeague={item} onPress={this.props.onPress} /&gt;;
    }
  </code></pre>