Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blazor] Support for direct using generic parameters as components at Razor pages #10972

Open
1 task done
macias opened this issue Oct 4, 2024 · 0 comments
Open
1 task done
Labels
Milestone

Comments

@macias
Copy link

macias commented Oct 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

It would boost productivity if we could use generic parameters as components directly in razor pages.

Consider such container and its razor page -- MyContainer<TComponent>

<h1>This is my component</h1>
<TComponent/>

This gives error and indeed it should give error:

But if we add the constraints:

class MyContainer<TComponent> where TComponent : ComponentBase

now we know that it is truly a component, and now it would be great if Razor could recognize it as in the snippet above.

Describe the solution you'd like

See above.

Additional context

No response

@javiercn javiercn transferred this issue from dotnet/aspnetcore Oct 7, 2024
@davidwengier davidwengier added the area-compiler Umbrella for all compiler issues label Oct 7, 2024
@chsienki chsienki added this to the Backlog milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants