Replies: 1 comment
-
Additionally, as stated on https://blazor-university.com/components/multi-threaded-rendering/ a component could be caused to re-render for many reasons, including (but not limited to).
This can make it complex to always prevent infinite renders from the start, in the development process. |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
Scenario & Problem:
In Blazor Server, we’ve seen scenarios where a child component and its parent can get into a “ping-pong” rendering cycle. For example, the parent triggers a render in the child, which in turn triggers a state change in the parent, ad infinitum. This can quickly chew up CPU and server resources, especially in Blazor Server where each render has a round-trip.
I’m wondering if there’s a way to:
Questions:
Motivation:
Are we heading in the wrong direction?
Perhaps we’re overcomplicating. If the recommended best practice is simply to refactor components to avoid mutual dependencies, I’d love to hear from others who’ve encountered (and solved) the infinite render problem. Also, if the community has alternative strategies or patterns for hooking into the lifecycle globally—without modifying the Blazor source or requiring a base class for all components—I’d love to get your insights.
Reference:
I’ve created an issue on this topic here: #59875.
Thanks in advance for any guidance or perspectives!
Beta Was this translation helpful? Give feedback.
All reactions