wasm.core::cell::panic_already_borrowed
for reactive closure passed to child component rendered with <For>
#2528
Unanswered
drakerossman
asked this question in
Q&A
Replies: 1 comment
-
I'm confused. Wouldn't this just trigger an infinite loop, when you're reading it in the UI?
Surely that's not what you want. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello @gbj,
I'm currently refactoring my Hackernews Userscript browser extension, and reached for leptos, so thank you very much for creating it.
Now, I am having trouble with the following (full example available at https://github.com/drakerossman/leptos-borrow-example):
Given, I have a top-level component
TopLevelWithItems
that is supposed to get thefiltered_items_from_localstorage
from localstorage, currently implemented as justserde_json::json!
for testing purposes.For each of those items, a component
FilteredItemWithCheckboxes
is to be rendered.Once the user checks/unchecks one of the chekboxes of such an item, the data in localstorage should update. Again, for testing purposes, this is currently implemented as simply
set_filtered_items.set(filtered_items_clone.get());
- it is suposed to just trigger theTopLevelWithItems
'supdate_items_in_localstorage
reactive closure by overwriting itself with a copy insideany_checkbox_is_true
(currently, regardless of checkboxes state).Now, I have propagated the
filtered_items: ReadSignal<Vec<FilteredItem>>
andset_filtered_items: WriteSignal<Vec<FilteredItem>>
signals down from theTopLevelWithItems
toFilteredItemWithCheckboxes
.The
FilteredItemWithCheckboxes
now does not render, with the following error:Should I comment out
set_filtered_items.set(filtered_items_clone.get());
, the error is no longer there.I am not sure how to fix that.
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions