Skip to content

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

Closed
@tstriker

Description

@tstriker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions