Skip to content

Blazor - Get Child or Parent Component #26826

@mrlife

Description

@mrlife

Is your feature request related to a problem?

It would be helpful to have a built in way to take a component reference and get a child or parent component of a certain type. When passing around component references, a parent component could be passed and then you automatically have access to its children.

This would be one way to do it

\\ MyComponentRef populated via `@ref`
var MyComponentRef2 = MyComponentRef.GetChildOfType(“MyComponent2”);

Additional context

Getting a child or parent component is a common JavaScript activity, so making it native to Blazor would support the mission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing one

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions