Skip to content

ComponentEx.hasChild method

ComponentEx › hasChild

Checks whether a component is a direct child of this one.

Only DIRECT children are reported — this is an ownership question, not a containment one. The caller that needs it is one holding several parents and deciding which of them a component belongs to, and for that a grandchild is the wrong answer: removing it from the parent that merely contains its parent would fail.

Signature:

hasChild(component: Component): boolean

Parameters:

ParameterTypeDescription
componentComponentThe component to look for.

Returns: booleanWhether the component is a direct child of this one.