Commit 0e51eef6 authored by Ian Sutherland's avatar Ian Sutherland Committed by Dan Abramov
Browse files

Disable service worker by default (#3817)

* WIP disable service worker by default (#2554)

* Updated service worker registration

* Readd default export in registerServiceWorker.js

* Updated comments about using Service Worker

* Call it serviceWorker

* Nits
parent 864874bf
Showing with 7 additions and 3 deletions
+7 -3
......@@ -2,7 +2,11 @@ import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/2vJdu84
serviceWorker.unregister();
......@@ -18,7 +18,7 @@ const isLocalhost = Boolean(
)
);
export default function register() {
export function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment