【发布时间】:2021-09-24 19:50:25
【问题描述】:
我尝试从反应路由器 3.2.6 迁移到 5.2.1 我也用过 react-router-redux。和react-router 5x不兼容,看来我们需要使用connected-react-router
在我的 app.tsx 中
import {hashHistory, Router} from "react-router";
import {synchHistoryWithStore} from "react-router-redux";
async function initApp(){
const store = await configureStore(
hashHistory
);
const history = syncHistoryWithStore(hashHistory, store);
hashHistory.listen((event: any) => {
});
ReactDom.render(
(
...
<Router history={history}
{routes}
</Router>
....
),
document.getElementById("app"),
);
}
只是不知道如何迁移。 在我的商店里我需要用什么来替换 hashHistory?
【问题讨论】:
标签: reactjs react-redux react-router