Async State
Async state refers to data that comes from asynchronous sources, such as API calls, and requires tracking additional states like loading, success, and error, beyond just the data itself.
The Three Common Async States
- Loading – The request is currently in progress.
- Success – The request completed successfully with data returned.
- Error – The request failed and an error message should be displayed.
Managing Async State Manually
Managing Async State with Redux Toolkit Query
RTK Query, part of Redux Toolkit, automatically manages loading, caching, and error states for API requests, significantly reducing manual async state management code.
Using React Query (TanStack Query)
React Query is a popular library specifically designed for managing async server state, including automatic caching, background refetching, and retry logic.
Server State vs Client State
It is important to distinguish between server state, which comes from and is synchronized with a backend, and client state, which is purely local application data, since each benefits from different management strategies.
Conclusion
Properly managing async state, whether manually or with tools like RTK Query or React Query, ensures your React Native application handles loading, success, and error scenarios gracefully and predictably.

