FaridSafi / react-native-gifted-listview

✌️ ListView with pull-to-refresh and infinite scrolling for Android and iOS React-Native apps
MIT License
1.62k stars 290 forks source link

refresh GiftListView at father componet #102

Open yangxiaoyao opened 7 years ago

yangxiaoyao commented 7 years ago

how can i refresh GiftListView at father componet? may be i should use _onFetch, but i don't have the callback...

Oxyaction commented 7 years ago

You can use internal method _refresh to do it

class MyCustomComponent extends Component {
  refresh() {
    this.refs.listview._refresh();
  }

  render() {
    return (
      <GiftedListView ref="listview"
         ...
      />
    );
  }
}