Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Add an Offline Status Indicator to a PWA with React

    reactReact
    16.6.3-16.8.6

    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.