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

Data loaders inside nested layouts do not wait for layout to finish loading before updating children #201

Closed
minht11 opened this issue Jul 15, 2023 · 0 comments · Fixed by #246
Assignees

Comments

@minht11
Copy link

minht11 commented Jul 15, 2023

While using nested layouts child routes do not wait for parent route loaders to finish loading, before updating children

Given following pages structure:

[slug]/
    index.vue
[slug].vue

Parent and child are using loaders, which resolve at different times, if parent loaders take longer to resolve child route will update first.

This is an issue because router navigation is delayed until all loaders are finished, but child updates theirs too early causing anything using loader data to use new page, while other things depending on router still use old data.

Expected behavior

Child routes should take into acount parent layout before changing their data.

Reproduction

https://stackblitz.com/edit/vitejs-vite-refftm

Screen.Recording.2023-07-16.at.01.20.24.mov
@posva posva added the bug label Jul 16, 2023 — with Volta.net
@posva posva self-assigned this Aug 8, 2023
posva added a commit that referenced this issue Aug 8, 2023
posva added a commit that referenced this issue Nov 28, 2023
@posva posva closed this as completed in 56b2a4d Feb 21, 2024
ian-aguilar added a commit to ian-aguilar/unplugin-vue-router that referenced this issue Oct 4, 2024
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

Successfully merging a pull request may close this issue.

2 participants