Add an Offline component

📱 Works only on a smartphone.

📡 What you will learn

  • Add offline feedback message
  • Use an advanced React Pattern: Context API

👾 Before we start the exercise

👨‍🚀 Exercise 3

Offline Example

  • Install the library
npm install react-native-offline
  • Update the entry point of your application to add a new provider
import { NetworkProvider } from 'react-native-offline';

NetworkProvider will injects the network state to children components via React Context.

🔭 Hint: Use !isConnected to check if the feature works when you are online.