Skip to content

Commit

Permalink
Remark on components as generic types (#33778)
Browse files Browse the repository at this point in the history
  • Loading branch information
guardrex authored Oct 3, 2024
1 parent 7397029 commit 1dab797
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aspnetcore/blazor/components/generic-type-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down

0 comments on commit 1dab797

Please sign in to comment.