Grokking React Native
Vote

0% completed

​

Persisting the Cache and Offline Mutations

Zero queries survive an app restart by default, because the React Query cache lives in memory. A cache in memory can show earlier results while the app runs, but it does not help a user who opens the app on an airplane. Saving the cache to the device is a separate decision, and changes that the user makes while offline need the same care.

The code here continues from the previous lesson. NetInfo is already connected to onlineManager, and UsersScreen is the screen that checks for data first. That screen shows a banner, "You are offline. Showing saved data

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content