Closed jedwards1211 closed 8 years ago
I'm going to move this discussion back to react-router
actually I changed my mind, I'm going to open a separate issue about making a standard package for route context
I will make a PR that moves the middleware to a more general-purpose package
This middleware is essentially putting info for each route (i.e.
route
,routes
, etc) on the context of that route's component.Yet I can imagine plenty of other scenarios in which one needs route info on the context; for instance a long time ago I created my own component to put add/remove leave hook methods on the context that work for any descendants of the route component.
Having a middleware wrapper for each feature like these that separately puts route info on the context seems wasteful when react-router itself could create route components within a context wrapper.