11 lines
269 B
TypeScript
11 lines
269 B
TypeScript
export default function RegisterServiceWorker() {
|
|
if ('serviceWorker' in navigator) {
|
|
import('./StartServiceWorker.tsx').then((mod) => {
|
|
const href = mod.default()
|
|
navigator.serviceWorker.register(href, { scope: '/', type: 'module' })
|
|
})
|
|
}
|
|
|
|
return <></>
|
|
}
|