Reputation: 61
I'm sorry because my english is pretty bad. I have a problem and would love to get some help.
I'm trying to get return value from component and update it in another component.
When component B's product selection button is pressed, the selected product will be bound to the main screen, then an item will be updated again in component A.
The weird thing is that the first time I select, nothing happens. The second time I select the product, the first item is added to component A.
Even in component A itself, when I increase or decrease the number of products, the data in component A itself gets the same error.
Here is my source code
Upvotes: 2
Views: 837
Reputation: 273824
In index.razor you have two async void
methods. Make them async Task
and await them in C#.
async void
runs unobserved, there is no UI update when they finish. You should never need async void
in Blazor. Blazor supports async Task
for eventhandlers.
Upvotes: 3