File tree 1 file changed +3
-3
lines changed
packages/react-scripts/template-typescript/src
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ type Config = {
25
25
onUpdate ?: ( registration : ServiceWorkerRegistration ) => void ;
26
26
} ;
27
27
28
- export function register ( config : Config ) {
28
+ export function register ( config ? : Config ) {
29
29
if ( process . env . NODE_ENV === 'production' && 'serviceWorker' in navigator ) {
30
30
// The URL constructor is available in all browsers that support SW.
31
31
const publicUrl = new URL (
@@ -62,7 +62,7 @@ export function register(config: Config) {
62
62
}
63
63
}
64
64
65
- function registerValidSW ( swUrl : string , config : Config ) {
65
+ function registerValidSW ( swUrl : string , config ? : Config ) {
66
66
navigator . serviceWorker
67
67
. register ( swUrl )
68
68
. then ( registration => {
@@ -106,7 +106,7 @@ function registerValidSW(swUrl: string, config: Config) {
106
106
} ) ;
107
107
}
108
108
109
- function checkValidServiceWorker ( swUrl : string , config : Config ) {
109
+ function checkValidServiceWorker ( swUrl : string , config ? : Config ) {
110
110
// Check if the service worker can be found. If it can't reload the page.
111
111
fetch ( swUrl )
112
112
. then ( response => {
You can’t perform that action at this time.
0 commit comments