You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article covers how to render Razor components from JavaScript, use Blazor custom elements, and generate Angular and React components.
16
16
17
+
> [!NOTE]
18
+
> We recommend using the `blazor.server.js` (Blazor Server) and `blazor.webassembly.js` (Blazor WebAssembly) scripts when integrating Razor components into an existing JavaScript app until better support for the `blazor.web.js` (Blazor Web App) script is added in the future. For more information, see [RegisterCustomElement stopped working in Blazor 8 (`dotnet/aspnetcore`#53920)](https://github.com/dotnet/aspnetcore/issues/53920#issuecomment-2261507850).
19
+
20
+
<!-- DOC AUTHOR NOTE: The `blazor.web.js` (Blazor Web App) portions of
21
+
this article have been commented out for the time being to
22
+
facilitate reconstituting the guidance later when support lands. -->
@@ -54,6 +61,8 @@ One or more initializer functions can be created and called by different compone
54
61
55
62
The following example demonstrates the dynamic registration of the preceding `Quote` component with "`quote`" as the identifier.
56
63
64
+
<!-- HOLD
65
+
57
66
:::moniker range=">= aspnetcore-8.0"
58
67
59
68
* In a Blazor Web App, modify the call to <xref:Microsoft.Extensions.DependencyInjection.ServerRazorComponentsBuilderExtensions.AddInteractiveServerComponents%2A> in the server-side `Program` file:
@@ -69,7 +78,7 @@ The following example demonstrates the dynamic registration of the preceding `Qu
69
78
70
79
:::moniker-end
71
80
72
-
:::moniker range="< aspnetcore-8.0"
81
+
-->
73
82
74
83
* In a Blazor Server app, modify the call to <xref:Microsoft.Extensions.DependencyInjection.ComponentServiceCollectionExtensions.AddServerSideBlazor%2A> in the `Program` file:
75
84
@@ -81,8 +90,6 @@ The following example demonstrates the dynamic registration of the preceding `Qu
81
90
});
82
91
```
83
92
84
-
:::moniker-end
85
-
86
93
* In a Blazor WebAssembly app, call <xref:Microsoft.AspNetCore.Components.Web.JSComponentConfigurationExtensions.RegisterForJavaScript%2A> on <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder.RootComponents> in the client-side `Program` file:
87
94
88
95
```csharp
@@ -179,6 +186,8 @@ Using a [JavaScript initializer](xref:blazor/fundamentals/startup#javascript-ini
0 commit comments