Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<button @ref="myButton" id="counterClick" class="btn btn-primary counterClickC" @onclick="IncrementCount">Click me</button>
@code {
private ElementReference myButton;
protected async override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await js.InvokeVoidAsync("initializeCounterComponent", myButton);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.