nikhilaravi/react-native-smart-scroll-view

Refresh control stops working when SmartScrollView is passed as `renderScrollComponent` prop to ListView component

Closed this issue · 3 comments

See example:

  render() {
    return (
      <ListView
        refreshControl={
          <RefreshControl
            renderScrollComponent={props => <SmartScrollView {...props} />}
            refreshing={this.state.refreshing}
            onRefresh={this._onRefresh.bind(this)}
          />
        }
        ...
      >
      ...
      </ListView>
    );
  }

@myaskevich sorry for the late reply! did you manage to figure out why it wasn't working?

Hi @nikhilaravi .

No, not yet. I rewrote the app so it didn't require to use react-native-smart-scroll-view.

@myaskevich oh okay.

Looking at this issue on a similar component, the suggestion is to use the renderScrollComponent Prop of the listView and not the RefreshControl.

<ListView
  renderScrollComponent={props => (
    <SmartScrollview
      {...props}
      .../>
  }}
 refreshControl={
    <RefreshControl
       refreshing={this.state.refreshing}
       onRefresh={this._onRefresh.bind(this)}
   />}
/>

Just in case you ever need to use SmarScrollView again!!!