尝试使用redux、不可变和react-redux-router创建应用程序。
使用的软件包的版本:
"immutable": "^3.8.2",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "^4.0.8",
"history": "^4.7.2",
"redux": "^3.7.2",
"redux-immutable": "^4.0.0"我正在使用history npm包中的createSagaMiddleware函数创建历史记录。
import createHistory from 'history/createBrowserHistory';
const browserHistory: any = createHistory();但是,如果我将历史记录的这个实例传递给syncHistoryWithStore函数,以便从商店同步我的位置和状态
const history = syncHistoryWithStore(browserHistory, store, {
selectLocationState: createSelectLocationState()
});当我试图导航到某个页面时,我得到了以下错误:

因为我的历史对象没有transitionTo函数。
在哪里可以获得适合此任务的History对象?
谢谢你的帮助!
发布于 2017-10-31 23:52:30
我认为,您应该更改react-router-redux的版本,因为" react-router -redux":"^4.0.8“只适用于react-router v3,但您使用的是react-router v4(react-router-dom)
npm i react-router-redux@next --save-devhttps://stackoverflow.com/questions/47034027
复制相似问题