// the find
rgommezz/react-native-offline
Handy toolbelt to deal nicely with offline/online connectivity in a React Native app. Smooth redux integration ✈️
A grab-bag of offline/online connectivity utilities for React Native: a Context-based provider/consumer, a useIsConnected hook, and a full Redux integration (reducer, middleware, saga, offline action queue) built on top of @react-native-community/netinfo. It's aimed squarely at Redux-based RN apps that need to detect real internet access (not just network state) and gracefully queue/replay actions when connectivity drops.
The offline queue is the actual meat here — it handles both plain FSA actions and thunks, supports duplicate detection/replacement, and lets you dismiss queued actions based on other dispatched actions (e.g. user navigated away), which is a more thoughtful design than a naive retry-on-reconnect. It also correctly distinguishes network state from actual internet access by pinging a remote server, something bare NetInfo doesn't do. Multiple integration levels (Context, hook, Redux) mean you can adopt just the piece you need instead of an all-or-nothing dependency.
Last commit is March 2023 — over three years stale — with no visible confirmation it's been validated against the New Architecture (Fabric/TurboModules) or recent Expo SDKs. The Redux tooling assumes classic FSA/thunk patterns (including using thunk.toString() for duplicate detection), which sits awkwardly with Redux Toolkit or RTK Query conventions most current Redux apps use, and offers nothing for non-Redux state (Zustand, React Query, Jotai) which is now common in RN. The default ping target is google.com, silently breaking connectivity detection for users in China unless you remember to override it. It also pulls in @react-native-community/netinfo as a native dependency requiring manual linking/pod install, adding native-module weight for logic that's mostly just JS orchestration.