From the course: React: Building Progressive Web Apps (PWAs)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Register the service worker

Register the service worker - React.js Tutorial

From the course: React: Building Progressive Web Apps (PWAs)

Start my 1-month free trial

Register the service worker

- When you start to research progress web apps, you might start hearing a lot about service workers. So what are service workers? A service worker is a script that your browser runs in the background to perform various tasks. So it's essentially just a java script file that does things like caching resources, handling network requests and storing content for offline use. So if we serve up the build folder, serve hyphen S build, and we open this up on "localhost:5000", you can open up the application tab. There we go. And we see some information about service workers. Let's move that over a little bit. Here you'll find all of the active service workers that are on the page. You can also open up service workers that are added by other domains and you can choose to unregister them if you want to by clicking this unregister link, and then it'll remove it from the list. With create react app, we see this "serviceWorker.js" file. This has been provided to us by Create React App, and it's…

Contents