nikhilaravi / react-native-smart-scroll-view

A smart scroll view component with handling of keyboard events
MIT License
153 stars 31 forks source link

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

Closed mayask closed 8 years ago

mayask commented 8 years ago

See example:

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

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

mayask commented 8 years ago

Hi @nikhilaravi .

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

nikhilaravi commented 8 years ago

@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!!!