使用react router redux时,使用Webpack2和System.import进行代码拆分不起作用
我正在尝试使用Webpack2和System.import语法进行“代码拆分”,由于某些原因react router redux给我带来了麻烦 我的路线看起来是这样的使用react router redux时,使用Webpack2和System.import进行代码拆分不起作用,import,react-router-redux,webpack-2,Import,React Router Redux,Webpack 2,我正在尝试使用Webpack2和System.import语法进行“代码拆分”,由于某些原因react router redux给我带来了麻烦 我的路线看起来是这样的 <Provider store={Store}> <Router history={history}> <Route path="some-page" getComponent={(location, cb) => {
<Provider store={Store}>
<Router history={history}>
<Route
path="some-page"
getComponent={(location, cb) => {
System.import('./some-module.jsx')
.then((module) => cb(null, module.default))
.catch((error) => console.error('Dynamic page loading failed', error));
}}/>
</Router>
url发生了变化,但没有其他变化
现在,如果我使用react router browserHistory API,它就可以工作了
import { browserHistory } from 'react-router/es6';
browserHistory.push('/some-page');
如何用react router redux解决这个问题?
提前谢谢
import { browserHistory } from 'react-router/es6';
browserHistory.push('/some-page');