How to Check the Network Connection in Your Expo App

DavidDavid November 7, 2026 6 min read

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

QuestionAnswer
Installnpx expo install expo-network
Works in Expo Go?Yes
PlatformsAndroid, iOS, tvOS, web
Live status in a componentuseNetworkState()
One-off checkgetNetworkStateAsync()
Listen outside ReactaddNetworkStateListener(listener)
PermissionsNone 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

FieldiOSAndroid
isConnectedA network is upA network is up
isInternetReachableSame as isConnectedValidated internet access
typeWIFI, CELLULAR, ETHERNET, NONE, UNKNOWNAll types, incl. VPN and BLUETOOTH

Step 3: Show an offline banner with useNetworkState

Make one small component, call useNetworkState() inside it, and render a banner only when isConnected is explicitly false, or when isInternetReachable is explicitly false. Put that component in your root _layout.tsx so every screen gets it, and keep the copy short: "You are offline. Changes will sync when you reconnect" if you queue writes, or just "No connection" if you do not.

  • Check for false, not falsy. A strict === false check is what stops the undefined first render from showing the banner.
  • Do not block the whole app. Screens that read cached data, like a [local database](/blog/how-to-add-a-local-database-to-your-expo-app), should keep working underneath the banner.
  • Disable the buttons that cannot work offline and say why, instead of letting them fail on tap.
  • Use the type field sparingly. "You are on cellular" is useful before a big download like a [video](/blog/how-to-add-video-to-your-expo-app), and noise everywhere else.

Outside React, for example in a sync queue or a data layer, use addNetworkStateListener. It calls your function with the new state every time it changes and returns a subscription. Call remove() on that subscription when you are done, or the listener lives forever.

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

SituationUseWhy
Offline banner or status UIuseNetworkState()Updates itself and cleans up on unmount
Check once before an actiongetNetworkStateAsync()Returns the current state as a promise
Sync queue or data layeraddNetworkStateListener()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.

Free app-building tips, straight to your inbox

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

David

Written by

David

Founder and app builder

Keep reading

ExpoClaude Code

How to Add Notification Actions to Your Expo App

To add notification actions to an Expo app, register a category with Notifications.setNotificationCategoryAsync, give it action buttons (and optionally a text reply), set categoryIdentifier on the notification, then read response.actionIdentifier in a response listener. Here is every action option, how to handle taps when the app was closed, the Android and iOS differences, and a Claude Code prompt that wires it all up.

David 8 min
Read article
ExpoClaude Code

How to Schedule Local Notifications in Your Expo App

To schedule local notifications in an Expo app, install expo-notifications, set a notification handler, ask for permission, create an Android channel, then call scheduleNotificationAsync with your content and a trigger like DAILY, WEEKLY or DATE. Here is every trigger type, how to cancel and list what is scheduled, why Android reminders arrive late, and a Claude Code prompt that builds the whole reminder flow.

David 8 min
Read article

Ready to build it yourself?

Join App Store Launch Club, the #1 community for building and launching apps, for $9/month.

← Back to the blog