O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing offline content using Redux

At some point we will need to locally store the global state of our application, this will allow us to restore the state the next time the user opens the app. For example, we might want to keep the current view the user is using on the state. This way we can show the same view when the app gets loaded again.

We might also want to cache some information to avoid calling the API multiple times; this will improve the performance, as well as the traffic on your server.

On Chapter 4, Working with Application Logic and Data, we learned about different methods to store data on the device, so for this recipe, we will use AsyncStorage.

Getting ready

This recipe depends on the previous ones, so make sure to follow along with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required