title: Refreshing FlatList on pull up with react native redux
body: <p>I am trying to refresh FlatList data on pulling up using react-native redux. 
  And on pulling the FlatList data, the loading icon is appearing and disappearing but the list is not showing any updates that I have done on the database.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>    class flatRedux extends Component {
  
          componentWillMount() {
              this.props.listShow();
          }
          onRefresh = () =&gt; { 
                 this.props.loading = true,
                 this.props.flatlist= [],
  
                  () =&gt; {  
                        this.props.listShow();                      
                    }         
          }
  
          render() {
              if (this.props.loading) {
                  return &lt;Spinner size="large" /&gt;;
              }
              return (
                  &lt;View style={styles.MainContainer}&gt;
                      &lt;SearchBox
                          placeholder="Search..."
                          onChangeText={this._onSearchChange}
                      /&gt;
                      &lt;FlatList
                          onRefresh={() =&gt; this.onRefresh()}
                          refreshing={this.props.loading}
                          data={this.props.flatlist}
                          extraData={this.props}
                          ItemSeparatorComponent={this.FlatListItemSeparator}
  
                          keyExtractor={(item, index) =&gt; index.toString()}
  
                          renderItem={({ item }) =&gt;
                              &lt;Text key={item.id} style={styles.FlatListItemStyle} &gt;
                                  {item.cl_name} {'\n'} {item.check} &lt;/Text&gt;}
  
                         /&gt;
                  &lt;/View&gt;
              );
          }
      }
      const mapStateToProps = state =&gt; {
          return {
              flatlist: state.listShow.flatlist,
              loading: state.listShow.loading
          };
      };
      export default connect(mapStateToProps, { listShow, searchResult, searchShow })(flatRedux);
  
  </code></pre>
  
  <p>This one is Reducer's code:</p>
  
  <pre><code>import {FLAT_DATA } from '../actions/types';
  
  const INITIAL_STATE = {
      flatlist: [],
      loading: true
  };
  export default (state = INITIAL_STATE, action) =&gt; {
     console.log(action);
      switch (action.type) {
          case FLAT_DATA:
              return { ...state, flatlist: action.payload, loading: false };
          default:
              return state;
      }
  
  };
  
  </code></pre>