-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.tsx
43 lines (36 loc) · 1.33 KB
/
index.tsx
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
35
36
37
38
39
40
41
42
43
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from "react-router-dom";
import SamplesBrowser from "./navigation/SamplesBrowser";
import RegisterServiceWorker from './serviceWorker';
import { createRoot } from 'react-dom/client';
import './index.css'; // styles shared between all samples
// console.log('SB index');
// addEventListener('activate', function(event) {
// console.log('SB index activate');
// event.waitUntil(
caches.keys().then(function(keyList) {
return Promise.all(keyList.map(function(key) {
console.log('SB index cache delete ' + key);
return caches.delete(key);
}));
})
// );
// });
const container = document.getElementById('root');
const root = createRoot(container);
root.render(
<BrowserRouter basename={'/react-demos'}>
<SamplesBrowser />
</BrowserRouter>
);
// 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: https://bit.ly/CRA-PWA
RegisterServiceWorker();
// serviceWorker.unregister();
// // copied from https://stenciljs.com/docs/react
// import { applyPolyfills, defineCustomElements } from 'igniteui-dockmanager/loader';
// applyPolyfills().then(() => {
// defineCustomElements();
// });