首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

应用connected-react-router和redux-thunk打通react路由孤立

dispatch 带上路由信息作为 action 的负载将路由信息存到 store,同时要能将路由信息从 Redux store 里面同步获取出来 这些可以通过 react-router-redux、connected-react-router...官方文档中提到的是 react-router-redux,并且它已经被整合到了 react-router v4 中,但是根据 react-router-redux 的文档,该仓库不再维护,推荐使用 connected-react-router...在create-react-app中使用安装所需中间件: yarn add connected-react-router history redux react-redux redux-devtools-extension...import { createStore, applyMiddleware } from 'redux' import { connectRouter, routerMiddleware } from 'connected-react-router...{ render } from 'react-dom' import { Provider } from 'react-redux' import { ConnectedRouter } from 'connected-react-router

2.3K00
领券