Remark on components as generic types (#33778)

pull/33781/head
Luke Latham 2024-10-03 15:07:21 -04:00 committed by GitHub
parent 73970297a8
commit 1dab797da7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,8 @@ C# syntax with [`where`](/dotnet/csharp/language-reference/keywords/where-generi
@typeparam TEntity where TEntity : IEntity
```
A <xref:Microsoft.AspNetCore.Components.RenderFragment> generic type is supported, but components aren't supported as the generic type. To render components by type, consider using a <xref:Microsoft.AspNetCore.Components.DynamicComponent>. For more information, see <xref:blazor/components/dynamiccomponent>.
In the following example, the `ListItems1` component is generically typed as `TExample`, which represents the type of the `ExampleList` collection.
`ListItems1.razor`: