Open jonathaneckman opened 6 years ago
@jonathaneckman Ready for your next submission? :smile:
Haha yes I am! Good thing I have an excellent blog post to guide me.
I'd be happy to put my name on this once I understand a little more about the solution. I'd need to read the router code to understand the effort required, if the change is a good design, if it causes a breaking change, etc. Other priorities have filled my after hours time in January, so I cant commit to anything yet.
Alternatively this could be done by a (optional) router config setting (defaulting to current behaviour)? Would prevent it from being a breaking change, would allow users to decide for themselves whether this is preferable or not, etc. 👍
Might be wrong, but this could also maybe allow users to let a child router route back to the child router's "home" state and not navigate back to a parent router.
Nice ideas, @pndewit.
I'm submitting a feature request
Please tell us about your environment:
Operating System: Windows 10
Browser: Chrome
Language: TypeScript 2.2
Current behavior:
Expected/desired behavior: Do not leave the page. If the route we are going back to is not within the application, navigate back to the default route. Perhaps something like
router.navigateBackOrHome()
. Alternatively, provide a lifecycle hook where I can handle this myself. Custom navigation steps are not touched in this scenario.