Course lesson

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

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.

Duration
2 min
Access
Included
Transcript
Retained from source evidence

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