Build error when parameter and child component have the same name #5634
Labels
area-blazor
Includes: Blazor, Razor Components
bug
This issue describes a behavior which is not expected - a bug.
Add support for
@tagHelperPrefix
Problem
Current implementation of Blazor v0.6.0 does not have support for Razor
@tagHelperPrefix
Functional impact
Trying to Include a child component inside a RenderFragment of a parent component where both the child and the RenderFragment have the same name will result in compile time error.
Minimal repro steps
Let us suppose we have a component in
Panel.cshtml
as follows:and another component in
PanelHeader.cshtml
like this:then using these two components in a page like below code will result in a compile time error:
Proposal
I would recommend to add support for
@tagHelperPrefix
so to simplify distinguishing components from RenderFragments.Above code could then can be re-written as follows:
Panel.cshtml
would be like this:And
PanelHeader.cshtml
would look like this:And finally both the child and the parent components can be used like this:
The text was updated successfully, but these errors were encountered: