File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
- // @flow
2
-
3
- // #region imports
4
1
import React , { Component , Fragment } from 'react' ;
5
2
import { Router , Switch , Route } from 'react-router-dom' ;
6
- import { compose } from 'redux' ;
3
+ import { compose } from 'redux' ;
7
4
import createHistory from 'history/createBrowserHistory' ;
8
5
import withMainLayout from './hoc/withMainLayout' ;
9
6
import MainRoutes from './routes/MainRoutes' ;
@@ -13,9 +10,8 @@ import AuthProvider from './contexts/auth/providerComponent';
13
10
import { devToolsStore } from './contexts/withDevTools' ;
14
11
import Login from './pages/login' ;
15
12
import GlobalStyle from './style/GlobalStyles' ;
16
- // #endregion
17
13
18
- // #region flow types
14
+ // #region types
19
15
type Props = any ;
20
16
type State = any ;
21
17
// #endregion
@@ -29,7 +25,13 @@ const history = createHistory();
29
25
class Root extends Component < Props , State > {
30
26
componentDidMount ( ) {
31
27
// init devTools (so that will be visible in Chrome redux devtools tab):
32
- devToolsStore && devToolsStore . init ( ) ;
28
+ devToolsStore && devToolsStore ?. init ( ) ;
29
+ }
30
+
31
+ componentDidCatch ( error : any , info : any ) {
32
+ console . log ( 'App error: ' , error ) ;
33
+ console . log ( 'App error info: ' , info ) ;
34
+ //
33
35
}
34
36
35
37
render ( ) {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export type DevToolsMessage = {
12
12
} ;
13
13
14
14
export type DevTools = {
15
+ init : ( ) => void ;
15
16
connect : ( ) => any ;
16
17
subscribe : ( message : DevToolsMessage ) => any ;
17
18
send : ( action : { type : string ; state ?: any } , newState : any ) => any ;
@@ -22,6 +23,7 @@ export type DevTools = {
22
23
// #endregion
23
24
24
25
// #region constants
26
+ // @ts -ignore
25
27
const isDEV = process . env . NODE_ENV === 'development' ;
26
28
27
29
export const withDevTools =
You can’t perform that action at this time.
0 commit comments