-
-
Notifications
You must be signed in to change notification settings - Fork 627
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
Possible bug of Transition in sub view component in ssr/hydrate mode. The transition will always show fallback on all update #2279
Comments
Thanks for the report. It looks like it works if the subpage is shown unconditionally, i.e., if the second Transition is actually shown on the page when it hydrates. I'm sure this is just a bug in the Transition logic for hydration, which is very finicky. |
In my own investigations this seems likely. Looking at the debug output the second transition is rendered just as a suspense unconditional transition <!-- <Suspense> -->
<!--suspense-open-0-1-0-0-->
<!-- <DynChild> -->
<!--leptos-view|<Transition/>-children|open-->
<!-- <> -->
<div data-hk="0-1-0-3">
<!-- <DynChild> -->
<!--leptos-view|src-app.rs-36|open-->
<!-- <> --><p data-hk="0-1-0-6">this works fine! there will be no fallback after initial load0</p>
<button data-hk="0-1-0-7">Increment</button>
<!-- </> -->
<!--leptos-view|src-app.rs-36|close-->
<!-- </DynChild> -->
</div>
<!-- </> -->
<!--leptos-view|<Transition/>-children|close-->
<!-- </DynChild> -->
<!--suspense-close-0-1-0-0-->
<!-- </Suspense> --> vs conditional <!-- <Suspense> -->
<!-- <DynChild> -->
<!-- <> -->
<div>
<!-- <DynChild> -->
<!-- <> -->
<p>bug here!, every time updated, it will show loading!0</p>
<button>Increment</button>
<!-- </> -->
<!-- </DynChild> -->
</div>
<!-- </> -->
<!-- </DynChild> -->
<!-- </Suspense> --> |
Thanks, I've had some time to look at this and hopefully the attached fix is pretty straightforward. Please let me know if PR #2314 fixes the issue for you. |
Yes! I tested it and it works. thanks. |
Describe the bug
here is a minimal reproduce code:
https://github.com/shenjiangqiu/leptos_bug
When the Transition in top level component, it will work correctly.
When the view is rendered conditionally, the Transition will always show fallback for every update.
For example: the first Transition works file, but the second not.
Leptos Dependencies
To Reproduce
in my repo, run
cargo leptos watch
Expected behavior
the second Transition shouldn't show fall back after the initial run.
Screenshots
The text was updated successfully, but these errors were encountered: