Root.js
925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React from 'react';
import { Provider } from 'react-redux';
import MyRoutes from '../routes/MyRoutes';
import 'antd/dist/antd.less';
// import 'antd/dist/antd.css';
import '../less/index.less';
import { initEnvironment } from '../redux/actions/settingAction';
export default class Root extends React.Component {
constructor(props) {
super(props);
}
static propTypes = {
history: React.PropTypes.object.isRequired,
store: React.PropTypes.object.isRequired
}
componentDidMount() {
const { dispatch } = this.props.store;
dispatch(initEnvironment());
}
get content() {
return (
<MyRoutes history={this.props.history} />
)
}
get devTools() {
}
render() {
return (
<Provider store={this.props.store}>
<div style={{ height: '100vh', width: '100%' }}>
{this.content}
{this.devTools}
</div>
</Provider>
)
}
}