title: Adding a button in a FlatList in React Native
body: <p>I have a FlatList and I am trying to but a button below the items and when you click on the button it should display the name of the item in an alert. </p>
  
  <pre><code>class TopMovies extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
          apiTopLoaded: false,
          topPopularMovies: [],
      }
      this.conditionalTopPopular = this.conditionalTopPopular.bind(this);
      this.mybuttonclick = this.mybuttonclick.bind(this);
  }
  
  componentDidMount() {
  fetch('someurls')
      .then((response)=&gt;{
          response.json()
              .then((popularMovies) =&gt; {
                  this.setState({
                      apiTopLoaded: true,
                      topPopularMovies: popularMovies.results,
                  })
              })
      })    
  
  
  mybuttonclick() {
      Alert.alert(item.original_title)
  }
  
  conditionalTopPopular() {
      if(this.state.apiTopLoaded===true) {
          return(
                  &lt;FlatList
                      horizontal={true}
                      data={this.state.topPopularMovies}
                      renderItem={({ item }) =&gt; (
                      &lt;View&gt;
  
                          &lt;Text&gt;{item.original_title}&lt;/Text&gt;
                          &lt;Button onPress={this.mybuttonclick} title="hello"/&gt;
                      &lt;/View&gt;
                      )}
                      keyExtractor={item =&gt; item.id}
                  /&gt;
              &lt;/View&gt;
          )
  
      }
  }
  </code></pre>
  
  <p>I can see all the movie names in the list and I see buttons below the movie names, but when I click on it, it says "cant find variable item". The function <code>mybuttonclick</code> should alert the <code>item.original_title</code> prop because it displays correctly in the flatlist. Please help.</p>