-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Blazor] How updates are performed at runtime #14591
Comments
Calls to Was there anything more specific you wanted us to cover? |
@pranavkm I'm debugging a component and I see calling the StateHasChanged() calls the BuildRenderTree synchronously. It doesn't seem to be any asynchronous dispatch of the rendering. The problem with this is, if I call the StateHasChanged() 4 times, it will perform the whole rendering 4 times. The StateHasChanged shouldn't invoke any rendering directly. It should mark the component as "dirty" and schedule a new rendering. This way if the same component was told to have changed 4 times in the same call, it will be re-rendered only one time. The later should be a platform feature (All the ui frameworks have a kind of Invalidation mechanism). I'm sure this will improve the performance of the whole framework drastically. As well as simplifying components development. For the time being. I would patch this problem inside the component, but I'm having trouble to understand how it works, and the lack of documentation about this doesn't help. Hope it helps. |
|
I'm also needing a way to know when a component, and all its children are already created. Or similarly a method UpdateLayout, that I can call to force the layout to happen. |
@arivoir As far as i know, calling |
This is going to be covered by the docs, which we will implement in 5.0 timeframe. |
I created a component that is calling StateHasChanged at runtime when modifications happen. And there are various causes that can end up invoking this method in different parts of the ui. I need to optimize it because repeated updates are affecting the performance visibly. So I'm wondering how the updates are performed, and whether there is a way to batch the updates. Can you provide information about this part of Blazor?
The text was updated successfully, but these errors were encountered: