Re-Execute a Query with Pull To Refresh in React Native

InstructorKadi Kraman

Share this video with your friends

Send Tweet

Now we'll implement pull-to-refresh and refetch the data on Stories and Bookmarks. To do this, we'll create React component state in the HomeScreen to track whether the component is refreshing or not.

We'll set the FlatList with refreshing and onRefresh properties to allow for the native refresh behavior you would expect from an app.

Resources:

  • Re-executing queries: https://formidable.com/open-source/urql/docs/basics/react-preact/#reexecuting-queries

Checkpoint: Add pull to refresh