Add an Offline Status Indicator to a PWA with React

Chris Achard
InstructorChris Achard
Share this video with your friends

Social Share Links

Send Tweet
Published 6 years ago
Updated 5 years ago

Since we can view our app offline now, it may be important to tell our users that the app is operating in an offline mode. That way, we can let the user know that the app may not be fully functional until then re-connect to the Internet.

We'll use navigator.onLine to detect if there is a network connection present or not, and then we'll listen for the window's online and offline events to update the offline badge.