When you try to compose and consume a generic (typed) blazor component and expose a RanderFragment parameter, T is being restricted to be the same generic type of the component. Otherwise, the consuming component would show the below error when placing the template markup.
Example: <Component1> is a typed component with type T1, exposing a parameter named Header for example, that is RenderFragmanet<T2>
Now, in Component2 if you try to consume Component1 as below:
<Component1>
<Header></Header>
</Component1>
The below error would show:
The type or namespace 'T2' does not exist in the namespace '__Blazor....'.
Thanks
When you try to compose and consume a generic (typed) blazor component and expose a RanderFragment parameter, T is being restricted to be the same generic type of the component. Otherwise, the consuming component would show the below error when placing the template markup.
Example:
<Component1>is a typed component with type T1, exposing a parameter named Header for example, that isRenderFragmanet<T2>Now, in Component2 if you try to consume Component1 as below:
The below error would show:
The type or namespace 'T2' does not exist in the namespace '__Blazor....'.
Thanks