-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Change the access modifier of ComponentFactory to public to allow instatiation of components.
An even better solution is to add an interface IComponentFactory that is implemented by ComponentFactory and that is registered in the ServiceCollection.
My current use case for this:
I implemented a system to split a blazor/razor-components project into multiple modules that are loaded lazily. The modules define view-extensions that can be rendered whereever needed. The view-extension rendering engines does not know about the concrete type of the component at compile time but needs to instantiate a component (of a type that is known at runtime), configure it with some values and finally render it. Currently I need to copy the source of ComponentFactory to my project to allow this.
If you like, I can implement this and open a PR for it.