Closed
Description
Reproduction
https://router.vuejs.org/guide/essentials/dynamic-matching.html#Reacting-to-Params-Changes
Steps to reproduce the bug
- Create a Vue 3 + Vue Router project.
- Define a dynamic route (/users/:name) and map it to a component (User.vue)
- In User.vue, add the onUpdated hook to log changes
- Navigate from
/users/johnny
to/users/jolyne
. - Observe that
onUpdated
is called despite the docs claiming that the lifecycle hooks of the component will not be called.
Expected behavior
The documentation suggests that no lifecycle hooks (including onUpdated) should be called when reusing a component instance during route navigation (e.g., /users/johnny → /users/jolyne).
Actual behavior
onUpdated is triggered when route params change
Additional information
Even if User.vue has an empty (no rendered content), the onUpdated hook will still be triggered during the navigation steps described above.
Metadata
Metadata
Assignees
Labels
No labels