How to check the network connection in your Expo app, in short
Install expo-network, import useNetworkState, and call it in the component that shows connection status, usually a small banner in your root layout. The hook returns an object with three fields: type (Wi-Fi, cellular, none and so on), isConnected and isInternetReachable. It listens for changes and cleans up when the component unmounts, so you do not manage any subscription yourself.
Why bother: a screen that spins forever with no connection is what users report as your app being broken. A plain line that says you are offline turns that into something they understand and forgive. This post is the how-to for the detection part. For the bigger picture of caching and queueing, see [how to add offline support to your Expo app](/blog/how-to-add-offline-support-to-your-expo-app).
expo-network at a glance
| Question | Answer |
|---|---|
| Install | npx expo install expo-network |
| Works in Expo Go? | Yes |
| Platforms | Android, iOS, tvOS, web |
| Live status in a component | useNetworkState() |
| One-off check | getNetworkStateAsync() |
| Listen outside React | addNetworkStateListener(listener) |
| Permissions | None on iOS. On Android, ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE are added automatically |
Step 1: Install expo-network
Run npx expo install expo-network. Using expo install picks the version that matches your SDK, which on SDK 58 is the 58.0.x line. The module ships in Expo Go, so you can test it on a real phone straight away without a new [development build](/blog/expo-go-vs-development-build).
There is no permission prompt to design. iOS needs nothing, and on Android the module needs network and Wi-Fi state access, which it adds to your build automatically. You do not have to edit app.json for it, and you should not add other network permissions on its behalf.
Step 2: Know what each field actually means
This is the part most AI-written code gets wrong, because the field names sound more certain than they are.
- isConnected is true when there is an active network connection. It does not mean the internet works. It is false when the type is NONE or UNKNOWN.
- isInternetReachable is meant to tell you whether the internet can be reached on that connection. On Android it is strict: the network has to report internet capability, confirmed internet access, and a usable connection state. On iOS it is always the same value as isConnected, so it adds nothing there.
- type is a NetworkStateType value. WIFI, CELLULAR and ETHERNET work on Android and iOS. BLUETOOTH, VPN, WIMAX and OTHER are Android only. NONE means no connection, and UNKNOWN means the type could not be worked out. On the web, the type is UNKNOWN whenever there is a connection and NONE when there is not.
- All three fields are optional in the type. Treat undefined as "not known yet", not as offline, or your banner will flash on every app launch.
What the fields tell you on each platform
| Field | iOS | Android |
|---|---|---|
| isConnected | A network is up | A network is up |
| isInternetReachable | Same as isConnected | Validated internet access |
| type | WIFI, CELLULAR, ETHERNET, NONE, UNKNOWN | All types, incl. VPN and BLUETOOTH |
Step 4: Let a real request have the final word
Our take: the network state is a hint, and your own API call is the truth. Use the state to show the banner and to decide when to retry, but give every request a short timeout so a dead connection fails fast instead of hanging. When a request times out while the state says you are online, show the same offline message. That covers the iOS gap from Step 2 and the slow-server case at the same time.
When the state flips from offline back to online, retry quietly. That is where the listener earns its keep: the moment isConnected turns true again, flush any queued writes and refetch the screen the user is on. Then test it properly on a real phone. Turn airplane mode on and off, and also join a network with no working internet, because that second case is where most connection bugs hide.
Which API to use
| Situation | Use | Why |
|---|---|---|
| Offline banner or status UI | useNetworkState() | Updates itself and cleans up on unmount |
| Check once before an action | getNetworkStateAsync() | Returns the current state as a promise |
| Sync queue or data layer | addNetworkStateListener() | Works outside components, call remove() when done |
| Is the phone in airplane mode? | isAirplaneModeEnabledAsync() | Android only, so never rely on it for iOS |
Step 5: Skip the IP address unless you truly need it
expo-network also has getIpAddressAsync, which returns the device's IPv4 address, or 0.0.0.0 when it cannot get one. On the web it looks up the public IP through a third-party service instead. Almost no consumer app needs this. If you are building a local network tool, like a remote for a device on the same wifi, it is useful. Otherwise leave it out, because an IP address is personal data you would then have to account for in your privacy answers.
The same goes for isAirplaneModeEnabledAsync. It works on Android only. If you want to tell users why they are offline, "No connection" is honest on both platforms and needs no extra call.
Have Claude Code build it for you
Open your project in the Claude Code desktop app and describe the exact behavior you want. Left alone, AI-written code tends to treat isConnected as "the internet works", show the banner on the first undefined render, or install a second network library you do not need. A prompt that avoids all three:
The 10 second timeout in that prompt is a starting point, not a rule. Pick what fits your slowest real request. Then add a line to your [CLAUDE.md](/blog/claude-md-for-expo-apps) such as "Network: useNetworkState for UI only, check === false, requests always have a timeout" so a later session does not undo it.
The short version
To check the network connection in your Expo app: install expo-network, call useNetworkState() in a small banner component, and only show offline when a field is explicitly false. Remember that isConnected is not the same as working internet, that iOS reports isInternetReachable as the same value, and that a request with a timeout is the real test.
If you are building your first iOS app with Claude Code and Expo and want feedback on it before App Review, bring it to App Store Launch Club. Members share their builds and help each other get unstuck, and the [curriculum](/curriculum) covers the full path from first build to first users. If you are adding more native polish, our guides to [keeping the screen awake](/blog/how-to-keep-the-screen-awake-in-your-expo-app) and [controlling screen brightness](/blog/how-to-control-screen-brightness-in-your-expo-app) follow the same pattern. Join at applaunchclub.co for $9 a month.
Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.
Frequently asked questions
How do I check if the user is online in an Expo app?
Install expo-network with npx expo install expo-network and call useNetworkState() in your component. It returns isConnected and isInternetReachable and updates when the connection changes. For a single check, await getNetworkStateAsync().
Does expo-network work in Expo Go?
Yes. expo-network is included in Expo Go and supports Android, iOS, tvOS and the web, so you can test it on a real phone without a development build.
What is the difference between isConnected and isInternetReachable?
isConnected means there is an active network connection, which does not guarantee the internet works. isInternetReachable is meant to show whether the internet can be reached. On Android it requires validated internet access. On iOS it is always the same value as isConnected.
Why does my Expo app say it is online when nothing loads?
The phone is connected to a network that has no working internet, such as wifi waiting on a login page. On iOS both fields can still report true in that case. Give your requests a timeout and show an offline message when they time out.
Do I need permissions for expo-network?
No prompt and no manual setup. iOS needs no permission, and on Android the ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions are added automatically.
Can I detect airplane mode in Expo?
Only on Android, with isAirplaneModeEnabledAsync(). There is no iOS version, so for a cross-platform app show a general no connection message instead.
Last reviewed by David on November 7, 2026

