Skip to content

Can we restrict the child component type in RenderFragment property #21141

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

Closed
BenLampson opened this issue Apr 23, 2020 · 2 comments
Closed

Can we restrict the child component type in RenderFragment property #21141

BenLampson opened this issue Apr 23, 2020 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@BenLampson
Copy link

BenLampson commented Apr 23, 2020

This is the Blazor component project case.
Can we restrict the child component type in RenderFragment property?

I create the container component but I can't restrict the child component type, I try to use the TagHelper but it seems not to work yet.

I want the code like this
There's a property in the container component.

[Child(CardAction)]
[Parameter]
public RenderFragment Actions { get; set; }

And I create the child item like this one:

public partial class CardAction
{
 //My code...
}
@pranavkm pranavkm added the area-blazor Includes: Blazor, Razor Components label Apr 23, 2020
@pranavkm
Copy link
Contributor

Dup of #12302. We're looking at addressing this as part of 5.0

@pranavkm pranavkm added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Apr 23, 2020
@pranavkm pranavkm reopened this Apr 23, 2020
@ghost ghost added the Status: Resolved label Apr 23, 2020
@javiercn
Copy link
Member

javiercn commented May 8, 2020

Closing in favor of #12302. @pranavkm if you have any reason to leave this open, please say so.

@javiercn javiercn closed this as completed May 8, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants