kitze/mobx-router

beforeExit and beforeEnter hooks not run when new view is a subpage of the old one

Closed this issue · 1 comments

FROM MAIL:

Hi Kristijan,
simple and quick question: why running beforeExit and beforeEnter hooks are not run when rootViewChanged === false which is: when the new has the old one as a subpath? I havenot found the reason and I have a scenario that depend on this.

I have fixed this with changing this line with:

const rootViewChanged = !this.currentView || (this.currentView !== view);

My forked package fixes this problem. Until #56 get merged, feel free to use https://www.npmjs.com/package/mobx-router-3