wasm.core::cell::panic_already_borrowed
for reactive closure passed to child component rendered with <For>
#2528
-
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): For each of those items, a component 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 Now, I have propagated the The
Should I comment out I am not sure how to fix that. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
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.
A few observations:
I'm not sure why you say your code with the dummy signal is "unsound." Reading through it, this seems reasonable enough. It would be a bit cleaner to use a
Trigger
rather than the dummy signal.That said, this isn't how I'd structure this application at all. Basically the state flow right now is that local storage is the state management, and any time you change anything, you write everything into local storage and then read it back out of local storage, and you do the reads and writes imperatively inside rendering code, which is kind of messy. The example doesn't really use signals at all to manage the data -- just this one dummy signal to handle the overall state upd…