-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
NodeRef on_load panics when ref is remounted #2526
Labels
documentation
Improvements or additions to documentation
Comments
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When a ref is remounted, for example inside a
<Show>
, theon_load
handler panics. The issue appears to be thaton_load
usesCell.take()
in the render effect, so the closure is no longer available when the ref is remounted.The
NodeRef
also logs a warning when remounting refs:I think having a ref to a toggable element is a valid use case, but maybe I'm wrong there.
Leptos Dependencies
I first spotted the bug when using
0.6.9
, but the CodeSandbox uses this:To Reproduce
I made a small example in CodeSandbox to reproduce it: https://codesandbox.io/p/devbox/upbeat-johnson-h4mcsc.
In the CodeSandbox:
Expected behavior
I would expect
on_load
to be called again when the ref is remounted. It would also be nice if theNodeRef
warnings could be disabled. For example, by having some way to indicate that a ref is allowed to be remounted.The text was updated successfully, but these errors were encountered: