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

Changing layout make unexpected page life cycle #14947

Closed
Alireza1996Sh opened this issue Sep 18, 2022 · 1 comment
Closed

Changing layout make unexpected page life cycle #14947

Alireza1996Sh opened this issue Sep 18, 2022 · 1 comment

Comments

@Alireza1996Sh
Copy link

Environment

Nuxt project info:


  • Operating System: Linux
  • Node Version: v14.20.0
  • Nuxt Version: 3.0.0-rc.10
  • Nitro Version: 0.5.3
  • Package Manager: npm@6.14.17
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

codesandbox

Describe the bug

nuxt 3: change layout => mount page twice

unexpected life cycle during layout change

here is the structure:

pages
|-- index.vue
|-- other
|-- |-- index.vue
layouts
|-- default.vue
|-- custom.vue

the other page uses custom layout.
when we want to change route from a page with default layout (index) to a page with custom layout (other), other page life cycle will be like this:

mounted
unmounted (why unmounted?!!)
mounted (again!)

but if a page use same layout as previous page, the life cycle will be normal:
mounted

the problem always happen when using different layout than previous page

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

Let's track in #14573.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants