Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created May 17, 2020 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavilanch/30472576317fbbc971c2dd9ca295164a to your computer and use it in GitHub Desktop.
Save gavilanch/30472576317fbbc971c2dd9ca295164a to your computer and use it in GitHub Desktop.
<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