This code will help you to understand how to get the reference or instance of a component.
Component references are used to invoke methods from underlying components. Use the ref attribute for a component and define it filed with the same name and same type of component.
@page "/" <Counter IncrementValue="10" @ref="counter"></Counter> @code { private Counter counter; }
While the Counter component is rendered, the field counter is populated along with the component instance.
I would suggest you check the below link for better understanding:
https://docs.microsoft.com/en-in/aspnet/core/blazor/components#capture-references-to-components
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Component references are used to invoke methods from underlying components. Use the ref attribute for a component and define it filed with the same name and same type of component.
While the Counter component is rendered, the field counter is populated along with the component instance.
I would suggest you check the below link for better understanding:
https://docs.microsoft.com/en-in/aspnet/core/blazor/components#capture-references-to-components
need an explanation for this answer? contact us directly to get an explanation for this answer