title: RefreshControl implementation iOS and Android platforms
body: <p>I am very new to React Native programming. I am trying to implement a pull to refresh functionality in a ListView. So, I decided to use <a href="https://facebook.github.io/react-native/docs/refreshcontrol.html" rel="nofollow noreferrer">RefreshControl</a> Component. I have implemented the variable states and functions according to the document, but the <strong>_onRefresh()</strong> function is never getting called. Hence, progress bar is also not appearing on the top. </p>
  
  <p>My source code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// @flow
  'use strict';
  
  import React, {Component} from "react";
  import {
    StyleSheet,
    View,
    Image,
    Text,
    ListView,
    TouchableHighlight,
    RefreshControl,
  } from "react-native";
  
  var BookingRow = require('./bookingRow');
  var RequestRow = require('./requestRow');
  
  class Bookings extends Component {
    state: {
      dataSource: Object;
      //refreshing: false,
    };
    ds: Object;
  
    static propTypes = {
      authKey: React.PropTypes.string.isRequired,
      endpoints: React.PropTypes.object.isRequired,
      profile: React.PropTypes.object,
      optionalBookings: React.PropTypes.array,
      optionalRequests: React.PropTypes.array,
      translator: React.PropTypes.object,
      rowSelected: React.PropTypes.func,
    };
  
    constructor(props: Object) {
      super();
      this.ds = new ListView.DataSource({rowHasChanged: (r1, r2) =&gt; r1 !== r2});
      var set;
      if (typeof props.bookings !== 'undefined') {
        set = props.bookings;
      } else {
        set = props.requests;
      }
      this.state = {
        dataSource: this.ds.cloneWithRows(set),
        refreshing: false
      };
    }
  
    componentWillReceiveProps(props: Object) {
      var set;
      if (typeof props.bookings !== 'undefined') {
        set = props.bookings;
      } else {
        set = props.requests;
      }
      this.setState({
        dataSource: this.ds.cloneWithRows(set)
      });
    }
  
    _onRefresh() {
      console.log("_onRefresh");
      this.setState({refreshing: true});
      this.props.fetchBookings().then(() =&gt; {
        this.setState({refreshing: false});
      });
    }
  
    render() {
      console.log(this.state.refreshing);
      return (
        &lt;ListView
        refreshControl={
            &lt;RefreshControl
              refreshing={this.state.refreshing}
              onRefresh={this._onRefresh.bind(this)}
              //onRefresh={() =&gt; this.props.fetchBookings()}
            /&gt;
          }
          dataSource = {this.state.dataSource}
          enableEmptySections = {true}
          renderRow = {(rowData) =&gt; {
            if (typeof this.props.bookings !== 'undefined') {
              return (
                &lt;BookingRow
                  endpoints = {this.props.endpoints}
                  authKey = {this.props.authKey}
                  booking = {rowData}
                  profile = {this.props.profile}
                  translator = {this.props.translator}
                  rowPicked = {() =&gt; this.props.rowSelected(rowData)}
                /&gt;
              );
            } else {
              return (
                &lt;RequestRow
                  profile = {this.props.profile}
                  endpoints = {this.props.endpoints}
                  authKey = {this.props.authKey}
                  request = {rowData}
                  translator = {this.props.translator}
                  rowPicked = {() =&gt; this.props.rowSelected(rowData)}
                /&gt;
              );
            }
          }}
        /&gt;
      );
    }
  }
  
  const styles = StyleSheet.create({
  
  });
  
  module.exports = Bookings;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Where am I going wrong? Is there any prop that I have missed? What should I do to ensure that the pull gesture is detected by the ListView?</p>