Context:
We want to create an inhouse Blazor Library for our Blazor-WA projects. The Blazor Library contains template components which can be consumed by all of our other Blazor projects.
Some components in the Blazor Library are merged with JavaScript. Therefore we want to use the JS-Interop which is provided by Blazor.
Approach:
The ASP.NET Core Razor components class libraries (RCL) seem to be a suitable approach to create an Blazor Library. We have created an Blazor Library called BlazorLib
which is now implemented via RCL. The Blazor WebAssembyly Project called BlazorLib-dev
consumes the library BlazorLib
. Here is the Structure:
Problem:
RCL seem not to provide JavaScript Interop:
Question:
What is the correct approach to create an Blazor Library including JS-Interop, which can be consumed by any second Blazor-WA project?