首页 > redux-router 主要解决那块问题?

redux-router 主要解决那块问题?

看redux demo中的例子,其中用到redux-router(https://github.com/acdlite/redux-router)这个模块。看介绍说可以将路由信息加入到state中去,感觉没啥用,完全可以用react-router去获取路由参数!为啥还要redux-router?
第一次学习redux,不太理解。求解!谢谢


官方建议使用 redux-simple-router, https://github.com/rackt/redux-simple-router 其实目的也很简单,就是希望一个 APP 只有一个 state 而路由自然也是 state 的一部分, 使用这个类库可以同步 react-router 中的 router 信息到 redux 的 state 中统一管理。

【热门文章】
【热门文章】