Revize 1865a0be
Přidáno uživatelem Pavel Fidransky před více než 4 roky(ů)
client/src/index.js | ||
---|---|---|
3 | 3 |
import './index.css'; |
4 | 4 |
import App from './App'; |
5 | 5 |
import * as serviceWorker from './serviceWorker'; |
6 |
import { render } from '@testing-library/react'; |
|
7 | 6 |
|
8 |
fetch( |
|
9 |
"config.json").then((response) => response.json()).then(config => { |
|
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 => { |
|
10 | 16 |
window.config = config; |
17 |
|
|
11 | 18 |
ReactDOM.render( |
12 | 19 |
<React.StrictMode> |
13 | 20 |
<App /> |
14 | 21 |
</React.StrictMode>, |
15 |
document.getElementById('root') |
|
22 |
document.getElementById('root'),
|
|
16 | 23 |
); |
17 |
|
|
24 |
}) |
|
25 |
.catch(reason => { |
|
26 |
console.error(reason); |
|
18 | 27 |
}); |
19 | 28 |
|
20 |
|
|
21 |
|
|
22 |
|
|
23 | 29 |
// If you want your app to work offline and load faster, you can change |
24 | 30 |
// unregister() to register() below. Note this comes with some pitfalls. |
25 | 31 |
// Learn more about service workers: https://bit.ly/CRA-PWA |
Také k dispozici: Unified diff
re #58 massive code formatting