When you bootstrap your React app with create-react-app there is a file named registerServiceWorker.js which is imported and used in index.js as:
import React from 'react'
import ReactDOM from 'react-dom'
import App from 'App'
import registerServiceWorker from 'registerServiceWorker'
ReactDOM.render(<App />, document.getElementById('root'))
registerServiceWorker()
The official create-react-app documentation suggests to keep this service worker for production and says:
By default, it also includes a service worker so that your app loads from local cache on future visits.
An stackoverflow question also suggests the same.
But then there is this medium article which says not to use it with the default configuration:
Turn off service workers
If you’ve used something like create-react-app to bootstrap your project, you’ll want to turn off the built-in service worker if you haven’t specifically integrated it to work with your app. While usually harmless, it can cause some issues, so it’s best to just get rid of it up front
As I can't configure the service worker (new to React), should I use registerServiceWorker in production or not?
Also if my React app is an interactive authentication based app (which somehow makes it useless offline) do I need it at all?