Include the target route in `beforeExit`
Opened this issue · 0 comments
daedalus28 commented
I need to know what the target route is going to be in beforeExit
. There are a few use cases for this, like conditionally allowing navigation only between certain routes, or conditionally running cleanup of state if we know it won't be needed on the next page (but leaving it if it is needed, such as in a child routing situation). For now, I can accomplish this by caching the previous view in beforeExit
and moving the logic to beforeEnter
, but this seems wasteful and kinda dirty.
I'm pretty sure I can do this trivially by just additionally passing view
(and maybe even paramsObj
and queryParamsObj
) on this line:
mobx-router/src/router-store.js
Line 26 in e4eeb59
Thoughts?