What do I do if the name ‘JSRuntime.Current.InvokeAsync‘ does not exist in the current context?

After Blazor 3.0.0-preview3, the Current was deprecated, and you have to use something like the following code example.

Before

await JSRuntime.Current.InvokeAsync<string>("methods.print", "here is the message")

After

await JSRuntime.InvokeAsync<string>("methods.print", "here is the message")

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.