Replies: 2 comments 1 reply
-
If I change the first reference to use a closure: show_ingredient: move |consumable| { show_nested_ingredient(consumable); }, Then it works fine. Somehow I smell a Dioxus bug. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Could the callback be invoked recursively in that code path? Closures cannot be called recursively because they are FnMut |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a component to display a different dialog depending on an enum parameter:
(The names are terrible - something I need to fix still)
In the first case we show the
Ingredients
dialog. The user clicks a button which invokes theshow_nested_ingredients
which runs a navigator.push() command:This then displays the
NestedIngredients
dialog. The user clicks another button when invokes theshow_edit
button, which prints the "!!!!" debug message, and tries to call theshow_nested_ingredient
callback. This call back does nothing except print using tracing::debug!(). This message does not appear. Instead the attempt to call the callback panics with the error:If I reload the page and do the exact same thing it works. It only fails when I take the exact same sequence.
One theory I have had it that the callback is somehow borrowed and in use by the first
ConsumableNested
- does this make any sense?I have tried cloning the object in different places, but without success.
Also if I uncomment the "x" callback and calling the "x" callback, that works fine also, so it isn't a problem with the parameters.
How do I resolve?
Beta Was this translation helpful? Give feedback.
All reactions