Blazor, can't get embedded component to refresh

blazor webassembly

Question

I realize this isn't a released product so I'm just experimenting, hopefully some of you came across a solution to the problem I am experiencing.

I have Component B included in Component A. When an item in a list is selected, Component B sees that and loads and displays the necessary data.

However, when I select another item from the combo list from Component A, it will not refresh component B's list and I guess that is because OnInitAsync is not called subsequently.

Does anyone have any solution?

Popular Answer

For everybody not reading the comments, the solution was to call StateHasChanged() at the correct moment.

At sometime in development of blazor this requirement should be fulfilled automatically by the framework. See here



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow