Root.js 925 Bytes
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>
    )
  }
}