-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
I’m creating Razor components from code by inheriting from ComponentBase
. This approach allows me to set attributes like [Route("/Address")] easily. However, I cannot do the same for @renderMode.
I’ve converted many of my pages to be built via code using:
protected override void BuildRenderTree(RenderTreeBuilder __builder)
While this approach works well and gives me benefits such as better hot reload and better project structure, I’ve lost the ability to control render modes.
Using .cs files that inherit from ComponentBase
is convenient, but I need a way to specify the RenderMode for these programmatically-built components.
Describe the solution you'd like
I would like to be able to add Attribute [RenderMode(RederModeOption)]. This attribute will influence building and linking options for blazor project and could replace @rendermode
directive in the .razor file.
Additional context
No response