Function getComponentInParent

  • Searches for a given component type in the parent hierarchy of the given object.

    Type Parameters

    • T extends IComponent

    Parameters

    • obj: Object3D

      The object to start the search from - this object is also included in the search.

    • componentType: Constructor<T>

      The type of the component to search for.

    Returns T | null

    The first component of the given type found in the parent hierarchy of the given object.

    Example

    const myComponent = getComponentInParent(myObject, MyComponent);
    

Generated using TypeDoc