Projekt

Obecné

Profil

Stáhnout (813 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
import React from 'react';
2
import ReactDOM from 'react-dom';
3
import './index.css';
4
import App from './App';
5
import * as serviceWorker from './serviceWorker';
6

    
7
fetch('config.json')
8
  .then((response) => {
9
    if (response.ok) {
10
      return response.json();
11
    } else {
12
      throw new Error('Couldn\'t fetch config.json!');
13
    }
14
  })
15
  .then(config => {
16
    window.config = config;
17

    
18
    ReactDOM.render(
19
      <React.StrictMode>
20
        <App />
21
      </React.StrictMode>,
22
      document.getElementById('root'),
23
    );
24
  })
25
  .catch(reason => {
26
    console.error(reason);
27
  });
28

    
29
// If you want your app to work offline and load faster, you can change
30
// unregister() to register() below. Note this comes with some pitfalls.
31
// Learn more about service workers: https://bit.ly/CRA-PWA
32
serviceWorker.unregister();
(17-17/19)