-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add ability to pass @typeparam down to child components #7268
Copy link
Copy link
Closed
Labels
Components Big RockThis issue tracks a big effort which can span multiple issuesThis issue tracks a big effort which can span multiple issuesNeeds: DesignThis issue requires design work before implementating.This issue requires design work before implementating.affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentscomponent ecosystemIndicates an issue which also has impact on 3rd party component ecosystemIndicates an issue which also has impact on 3rd party component ecosystemenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing oneseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Metadata
Metadata
Assignees
Labels
Components Big RockThis issue tracks a big effort which can span multiple issuesThis issue tracks a big effort which can span multiple issuesNeeds: DesignThis issue requires design work before implementating.This issue requires design work before implementating.affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentscomponent ecosystemIndicates an issue which also has impact on 3rd party component ecosystemIndicates an issue which also has impact on 3rd party component ecosystemenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing oneseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is your feature request related to a problem? Please describe.
If you have a templated component, that's Generic and uses @typeparam, if you want to add other child components, you also have to specify the type when you declare them. For instance in a Grid:
In this setup, in order to have a strongly typed context passed to the Column templates, you have to specify explicitly TItem to each Column and cannot be inferred by the List.
Describe the solution you'd like
With the current setup we can pass simple parameters down to child components with:
I would like to have the ability to aslo pass down @typeparam values. Perhaps something like:
And if the child component declares it's own TItem, it will override the Cascading value.