react-router-redux 主要 能在组件内用 store.dispatch(push('/)),
此功能可以用 history 代替
// history.js
import createHistory from 'history/createBrowserHistory';
const history = createHistory();
export default history;
// index.js
import React from 'react';
import ReactDOM from 'react-dom';
import { Router } from 'react-router';
import history from './history';
import App from './app';
ReactDOM.render(
<Router history={history}>
<App />
</Router>,
document.getElementById('app')
);
react-router4 跟 redux 搭配,非路由组件,就是非直接匹配的 路由组件,
withRouter(connect(...)(App)), 这样App组件内 props上就可以获取路由参数了