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.
For more information, refer to the link capture-references-to-components.
Share with