From 1d8cb18eb54e1929b66720e1d57a1ed8163a271e Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 29 May 2019 12:58:52 -0500 Subject: [PATCH] Blazor JS interop: call void functions (#12584) --- aspnetcore/blazor/javascript-interop.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aspnetcore/blazor/javascript-interop.md b/aspnetcore/blazor/javascript-interop.md index e647530c86..1befbb906d 100644 --- a/aspnetcore/blazor/javascript-interop.md +++ b/aspnetcore/blazor/javascript-interop.md @@ -5,7 +5,7 @@ description: Learn how to invoke JavaScript functions from .NET and .NET methods monikerRange: '>= aspnetcore-3.0' ms.author: riande ms.custom: mvc -ms.date: 05/21/2019 +ms.date: 05/29/2019 uid: blazor/javascript-interop --- # Blazor JavaScript interop @@ -101,6 +101,10 @@ The sample app includes a component to demonstrate JavaScript interop. The compo 1. The `showPrompt` function accepts user input (the user's name), which is HTML-encoded and returned to the component. The component stores the user's name in a local variable, `name`. 1. The string stored in `name` is incorporated into a welcome message, which is passed to a JavaScript function, `displayWelcome`, which renders the welcome message into a heading tag. +## Call a void JavaScript function + +JavaScript functions that return [void(0)/void 0](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/void) or [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined) are called with `IJSRuntime.InvokeAsync`, which returns `null`. + ## Detect when a Blazor app is prerendering [!INCLUDE[](~/includes/blazor-prerendering.md)]