Skip to content

Bug in the invocation order of lifecycle hooks during component remounting/unmounting controlled via key #13332

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

Open
Huangxianli opened this issue May 15, 2025 · 1 comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. need guidance The approach/solution in the PR is unclear and requires guidance from maintainer to proceed further.

Comments

@Huangxianli
Copy link

Vue version

3.5.14

Link to minimal reproduction

https://play.vuejs.org/#eNp9U01v2zAM/SuELrGBwD5sp8wJtg49bEO3YR83XVybcdzIkiHJaYrA/72U5Kh1keZkiu898VGkT+xL32eHAdmKFabSbW/BoB36DZdt1ytt4avqethq1cEiy93B0RefIn4CjVsYJ8qEcVkpaSzoUtaq+4FPsHa05K60uywkkzQlYqBVu1I2GGhJCusNnLiEF3V2KMWAa5jJST26SkUejJNlOljselFapBNA4c2v9vi05izexhnkAb4frFUSPleirfZEiT4424QYSGuKPBBJVOSvCrAls4Y62LZN9mCUpEf0vukiqtsK1L9621KHnK1CRw4rhVCP333O6gGX53y1w2p/If9gji7H2W+NBvUBOYuYLXWDNsC3f3/ikeIIdqoeBLGvgH/QKDE4j4F2M8iabL/iebff/Khb2fwzt0eL0pybckYdc/R8zmj87snfa/3F7ofso9fRDOkVz2v1/haeQMkb3CqNd2qQdqmk/2JNUcj/l92ETBHWb7dydkWSpG7P3AIqgZlQTbKYERbp6HYsVrosmMBInpm5VmOiRGF0fVkU4Ulwbevr9uAD8D+vT+UhN1/f8RlJ5F6x

Steps to reproduce

1.Open the browser console
2.Click button
3.Check the console output

What is expected?

The output order is: onBeforeUnmount -> onUnmounted -> onBeforeMount -> onMounted

What is actually happening?

The output order is: onBeforeUnmount -> onBeforeMount -> onUnmounted -> onMounted

System Info

Any additional comments?

No response

@linzhe141
Copy link
Contributor

linzhe141 commented May 15, 2025

It is similar to this issue
#12460

The root cause
#12482 (comment)

@edison1105 edison1105 added need guidance The approach/solution in the PR is unclear and requires guidance from maintainer to proceed further. 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. need guidance The approach/solution in the PR is unclear and requires guidance from maintainer to proceed further.
Projects
None yet
Development

No branches or pull requests

3 participants