import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { lazilyLoadWrapper } from 'react-kit/lazilyLoad';
import RouteTest from './test5';
import { connect, registReducers } from 'react-kit/redux';
import { withRouter } from 'react-kit/webRouter';

// 这里只执行一遍，因为没有概念

const K = class extends Component {
    componentDidMount() {
        registReducers();
    }
    render() {
        const { mul, ...props } = this.props;
        console.log({ Klocation: props.location });
        const context = this.context;
        return <div>lazilyLoad:mul(8*9)={mul(8, 9)}
            <br />
            pathname:{props.location.pathname}
            <br />
            <RouteTest />
        </div>
    }
};
K.contextTypes = {
    store: PropTypes.object
}

export default withRouter(connect(props => {
    return {};
})(lazilyLoadWrapper(K, {
    mul: () => require('bundle-loader?lazy&name=mul!./test2')
}
)));
