Show a Full Screen Notification When the React Native App is Offline with useNetInfo Hook

InstructorKadi Kraman

Share this video with your friends

Send Tweet

We'll use React Native NetInfo to detect whether the user's device is offline. If the device is offline, we will show a full screen "you are offline" message.

Resources:

  • React Native NetInfo: https://github.com/react-native-netinfo/react-native-netinfo

Expo:

  • If using Expo, install the library with expo install @react-native-community/netinfo as per the docs

Checkpoint: Show a full screen error when the app is offline