Search code examples
componentsblazor

How to subscribe component load event in blazor?


Could someone help me how to handle when a component is loaded?

I want to make an event handler for loaded. Is there is any loaded event in the component base in blazor or do I have to implement everything as I wanted?


Solution

  • Take a look at this picture:

    enter image description here

    The concept of "Loaded" is not so clear but the end on Onitialized would be the best spot. The parameters are set, including your callback event.

    But do consider, why would you need this? It is not customary. Components are easier to use when they are independent, even more so in a Web app.