Open teacher-zhou opened 4 years ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Hi. Thanks for contacting us. While there hasn't been much community interest in this feature yet, I'm inclined to leave this open as it may be something we may want to revisit in the future.
I would certainly use the feature if it's added. At the moment in my codebase I have pairs of components named like
<DynamicFoo>
<Foo T="item">
where Dynamic is the one without a generic parameter, as a workaround
This certainly would be useful. If I have a generic component, I'd like to allow to omit generic parameter, and simply use object. I hoped to be able to create two components:
class MyComponent<T>
class MyComponent: MyComponent<object>
Another option would be to allow to provide default generic parameter, but that feels less "csharp-y".
This affects also my code, as for some generic controls (list of checkboxes, I have items and values, sometimes however they TItem can be TValue, otherwise you have an required lambda to extract a TValue from an TItem. If that makes sense.
I would like to be able to make components that could be used in a maner like this:
<RadioButtonList Items=@items @bind-Selection=@selected />
<RadioButtonList Items=@items @bind-Selection=@selected ValueForItem="@((item) => item.Id)" />
I defind the component like this as below
but I cannot just use the one generic type component in razor file
The message shows : Multiple components use tag MyComponent with red underline by VS error.
Further technical details