Closed deser closed 8 years ago
Consider I do this oncomponentDidMount : router.setRouteLeaveHook(this.props.route, nextLocation => { }
componentDidMount
router.setRouteLeaveHook(this.props.route, nextLocation => { }
Here nextLocation has no name (see https://monosnap.com/file/fu4lfRSvY8qytBM6N7138yYbTqaucD)
nextLocation
name
That's correct – at that point the route hasn't been matched yet, so no name is applicable.
I'm not sure that this is right behavior. And actually it might not be a problem to match name for future route.
Consider I do this on
componentDidMount
:router.setRouteLeaveHook(this.props.route, nextLocation => { }
Here
nextLocation
has noname
(see https://monosnap.com/file/fu4lfRSvY8qytBM6N7138yYbTqaucD)