taion / use-named-routes

[No Maintenance Intended] Drop-in named route support for React Router
MIT License
105 stars 8 forks source link

setRouteLeaveHook returns in callback wrong location object #19

Closed deser closed 8 years ago

deser commented 8 years ago

Consider I do this oncomponentDidMount : router.setRouteLeaveHook(this.props.route, nextLocation => { }

Here nextLocation has no name (see https://monosnap.com/file/fu4lfRSvY8qytBM6N7138yYbTqaucD)

taion commented 8 years ago

That's correct – at that point the route hasn't been matched yet, so no name is applicable.

deser commented 8 years ago

I'm not sure that this is right behavior. And actually it might not be a problem to match name for future route.