ryanflorence / react-router-relative-links

MIT License
78 stars 10 forks source link

shouldn't react-router put the route info on route components' contexts instead of this middleware? #3

Closed jedwards1211 closed 8 years ago

jedwards1211 commented 8 years ago

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.

jedwards1211 commented 8 years ago

I'm going to move this discussion back to react-router

jedwards1211 commented 8 years ago

actually I changed my mind, I'm going to open a separate issue about making a standard package for route context

jedwards1211 commented 8 years ago

I will make a PR that moves the middleware to a more general-purpose package