Closed
Description
Background and Motivation
We currently have an experimental support package Microsoft.AspNetCore.Components.CustomElements that enables rendering Blazor components using custom HTML elements. This makes it easier to utilize Blazor in projects built on other web frameworks. Since this is a scenario we strongly care about, we'd like to productize this feature as an officially supported package (see #38447).
Proposed API
namespace Microsoft.AspNetCore.Components.Web;
+ public static class CustomElementsJSComponentConfigurationExtensions
{
+ public void RegisterAsCustomElement<TComponent>(this IJSComponentConfiguration configuration, string customElementName) where TComponent : IComponent;
}
Usage Example
var builder = WebAssemblyHostBuilder.CreateDefault(args);
// ...
builder.RootComponents.RegisterAsCustomElement<MyComponent>("my-custom-element");