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

Suspense's fallback rendered manually with slot is not reactive #4556

Closed
posva opened this issue Sep 10, 2021 · 1 comment
Closed

Suspense's fallback rendered manually with slot is not reactive #4556

posva opened this issue Sep 10, 2021 · 1 comment
Labels
🐞 bug Something isn't working scope: suspense

Comments

@posva
Copy link
Member

posva commented Sep 10, 2021

Version

3.2.11

Reproduction link

sfc.vuejs.org/

Steps to reproduce

  • Open link

What is expected?

The increment update suspense's fallback template

What is actually happening?

It stays as the initial value


From vuejs/router#1114

This is a very simplified version of what RouterView does to render its content

@posva posva added 🐞 bug Something isn't working scope: suspense labels Sep 10, 2021
@edison1105
Copy link
Member

edison1105 commented Sep 11, 2021

as a workaround:

    <template #fallback>
      <div :key="percentage">
        <h1>Loading {{ percentage }} </h1>
      </div>
    </template>

empty dynamicChildren will also take the fast path in patchElement.
so I think maybe should avoid set dynamicChildren to an empty array.
or update the condition as below:

-if (dynamicChildren) {
+if (optimized && dynamicChildren) {
	patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);
	if (parentComponent && parentComponent.type.__hmrId) {
		traverseStaticChildren(n1, n2);
	}
}

image

@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: suspense
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants