Open hecmonn opened 6 years ago
Pull to refresh feauture not working
_onRefresh=()=> { this.setState({refreshing: true}); const{username}=this.state; this.props.getInspiration({username,offset:0}) .then(r=>{ this.setState({posts.data.posts,refreshing: false}) }); }
<MasonryList onRefresh={this._onRefresh} refreshing={this.state.refreshing} horizontal={false} onEndReached={this._onLoadMore} keyExtractor={this._keyExtractor} numColumns={2} getHeightForItem={() => 1} data={this.state.posts} renderItem={(item)=><Card auser={this.state.username} item={item}/>} />
If i set refreshing=true, the loading indicator shows, however when I pull to call my _onRefresh function, nothing happens.
Is pull to refresh working?
Pull to refresh feauture not working
_onRefresh=()=> { this.setState({refreshing: true}); const{username}=this.state; this.props.getInspiration({username,offset:0}) .then(r=>{ this.setState({posts.data.posts,refreshing: false}) }); }
<MasonryList onRefresh={this._onRefresh} refreshing={this.state.refreshing} horizontal={false} onEndReached={this._onLoadMore} keyExtractor={this._keyExtractor} numColumns={2} getHeightForItem={() => 1} data={this.state.posts} renderItem={(item)=><Card auser={this.state.username} item={item}/>} />
If i set refreshing=true, the loading indicator shows, however when I pull to call my _onRefresh function, nothing happens.