react-router-redux 将react-router 和 redux 集成到一起,用redux的方式去操作react-router。例如,react-router 中跳转需要调用 router.push(path),集成了react-router-redux 就可以通过dispatch的方式使用router,例如跳转可以这样做 store.dispatch(push(url))。本质上,是把react-router自己维护的状态,例如location、history、path等等,也交给redux管理。一般情况下,是没有必要使用这个库的。
为什么要用react-router-redux
最新推荐文章于 2023-07-10 23:12:16 发布