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. |
0 replies
|
Could the callback be invoked recursively in that code path? Closures cannot be called recursively because they are FnMut |
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
Ingredientsdialog. The user clicks a button which invokes theshow_nested_ingredientswhich runs a navigator.push() command:navigator .push(Route::ConsumableList{ dialog: ListDialogReference::NestedIngredients { parent_id: parent.id, consumable_id: consumable.id} });This then displays the
NestedIngredientsdialog. The user clicks another button when invokes theshow_editbutton, which prints the "!!!!" debug message, and tries to call theshow_nested_ingredientcallback. 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?
All reactions