connected-react-router
时间: 2023-05-02 15:07:26 浏览: 109
connected-react-router是一个专门为React和Redux开发的库,它提供了一种将React Router v4集成到Redux应用程序中的简单方法。这个库使用react-router-redux中间件,可以将当前的路由状态(location)储存到Redux的store中,并可以通过Redux来管理路由状态。因此,我们可以将路由状态作为state的一部分,来实现路由的可预测性和可调试性。
除此之外,connected-react-router还提供了一些方便的作用于, 包括:
1. routerMiddleware: Redux middleware, 可以捕获路由器事件并将其触发到Redux中,从而生成新的状态。
2. push, replace, go, goBack, goForward: 路由操作的辅助函数,可以使用这些功能来在应用程序中改变路由状态。
3. ConnectedRouter: 一个React组件,可以使您的应用程序与Redux结合使用路由器。与常规路由器相比,这个连通路由器可以使我们从状态管理中获得许多好处。
总之,connected-react-router提供了一种简便的方式来将React Router v4集成到Redux应用程序中,并给开发者提供了更加可预测和可调试的路由状态管理方式。这个库已经被广泛使用,并且有很好的社区支持。如果你正在构建Redux应用程序,并打算使用React Router的话,connected-react-router是一个绝不会让你失望的选择。
相关问题
redistribute connected router-map
I apologize, but I am an AI language model and I am not sure what you are asking for. Can you please provide me with more context or information so I can better understand your request and assist you?
redistribute connected router-map loo3
I'm sorry, but I cannot perform this task. As an AI language model, I do not have the capability to access or modify network configurations. Please provide more context or information about what you are trying to achieve, so I can try to assist you better.