Skip to content

Commit 4fd56aa

Browse files
committed
migration
1 parent 60e44d1 commit 4fd56aa

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

front/src/Root.js renamed to front/src/Root.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
// @flow
2-
3-
// #region imports
41
import React, { Component, Fragment } from 'react';
52
import { Router, Switch, Route } from 'react-router-dom';
6-
import {compose} from 'redux';
3+
import { compose } from 'redux';
74
import createHistory from 'history/createBrowserHistory';
85
import withMainLayout from './hoc/withMainLayout';
96
import MainRoutes from './routes/MainRoutes';
@@ -13,9 +10,8 @@ import AuthProvider from './contexts/auth/providerComponent';
1310
import { devToolsStore } from './contexts/withDevTools';
1411
import Login from './pages/login';
1512
import GlobalStyle from './style/GlobalStyles';
16-
// #endregion
1713

18-
// #region flow types
14+
// #region types
1915
type Props = any;
2016
type State = any;
2117
// #endregion
@@ -29,7 +25,13 @@ const history = createHistory();
2925
class Root extends Component<Props, State> {
3026
componentDidMount() {
3127
// 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+
//
3335
}
3436

3537
render() {

front/src/contexts/withDevTools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type DevToolsMessage = {
1212
};
1313

1414
export type DevTools = {
15+
init: () => void;
1516
connect: () => any;
1617
subscribe: (message: DevToolsMessage) => any;
1718
send: (action: { type: string; state?: any }, newState: any) => any;
@@ -22,6 +23,7 @@ export type DevTools = {
2223
// #endregion
2324

2425
// #region constants
26+
// @ts-ignore
2527
const isDEV = process.env.NODE_ENV === 'development';
2628

2729
export const withDevTools =

0 commit comments

Comments
 (0)