|
1 | | -import React from 'react'; |
2 | | -import ReactDOM from 'react-dom'; |
3 | | -import RedBox from 'redbox-react'; |
| 1 | +import React from 'react' |
| 2 | +import ReactDOM from 'react-dom' |
| 3 | +import RedBox from 'redbox-react' |
4 | 4 |
|
5 | | -import store from './store/store'; |
6 | | -import history from './store/history'; |
7 | | -import AppProvider from './provider/index'; |
| 5 | +import store from './store/store' |
| 6 | +import history from './store/history' |
| 7 | +import AppProvider from './provider/index' |
8 | 8 |
|
9 | | -const ENTRY_POINT = document.querySelector('#react-app-root'); |
| 9 | +const ENTRY_POINT = document.querySelector('#react-app-root') |
10 | 10 |
|
11 | 11 | // creating starting endpoint for app. |
12 | 12 | const render = () => { |
13 | | - ReactDOM.render(<AppProvider store={store} history={history} />, ENTRY_POINT); |
14 | | -}; |
| 13 | + ReactDOM.render(<AppProvider store={store} history={history} />, ENTRY_POINT) |
| 14 | +} |
15 | 15 |
|
16 | 16 | // this will help us understand where the problem is located once app will fall. |
17 | 17 | const renderError = (error) => { |
18 | | - ReactDOM.render(<RedBox error={error} />, ENTRY_POINT); |
19 | | -}; |
| 18 | + ReactDOM.render(<RedBox error={error} />, ENTRY_POINT) |
| 19 | +} |
20 | 20 |
|
21 | 21 | // register serviceWorkers if available |
22 | 22 | // we don't need them for now |
@@ -45,14 +45,14 @@ if (__DEV__) { |
45 | 45 |
|
46 | 46 | // Wrap render in try/catch |
47 | 47 | try { |
48 | | - render(); |
| 48 | + render() |
49 | 49 | } catch (error) { |
50 | | - console.error(error); |
51 | | - renderError(error); |
| 50 | + console.error(error) |
| 51 | + renderError(error) |
52 | 52 | } |
53 | 53 | } else { |
54 | 54 | // ======================================================== |
55 | 55 | // PRODUCTION GO! |
56 | 56 | // ======================================================== |
57 | | - render(); |
| 57 | + render() |
58 | 58 | } |
0 commit comments