-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathindex.web.js
More file actions
34 lines (27 loc) · 790 Bytes
/
index.web.js
File metadata and controls
34 lines (27 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {AppRegistry} from 'react-native';
import App from './src/App';
import './web/index.css';
const appName = 'Sup';
AppRegistry.registerComponent(appName, () => App);
AppRegistry.runApplication(appName, {
rootTag: document.getElementById('root'),
});
// Load fonts
require('./web/load-fonts').default();
// Enable webpack hot reloading
if (module.hot) {
module.hot.accept();
}
// Register service worker
if ('serviceWorker' in navigator && !__DEV__) {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/service-worker.js')
.then(registration => {
console.log('SW registered: ', registration);
})
.catch(registrationError => {
console.log('SW registration failed: ', registrationError);
});
});
}