Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route change should not be changing state until the previous component has been unmounted #1945

Closed
aJamDonut opened this issue Jul 29, 2023 · 1 comment

Comments

@aJamDonut
Copy link

What problem is this solving

Copied from here: vuejs/vue-router#3393

Is it sorted?

What problem does this feature solve?
When navigating between routes, the changes to state happen before the previous component has been unmounted.

This results in recalculation of any computed properties that rely on the state, even though we'll remove this component a millisecond later.

Route change should fire all relevant navigation signals, but it shouldn't change the state until the old component has been unmounted, as otherwise it's creating side-effects

What does the proposed API look like?
the step 11 "dom updates triggered" here https://next.router.vuejs.org/guide/advanced/navigation-guards.html#the-full-navigation-resolution-flow should be split up into
unmount old component -> update route state -> mount new component

Proposed solution

Unmount when changing routes

Describe alternatives you've considered

Use something other than vue

@aJamDonut
Copy link
Author

No longer needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant