Function useElementSize

Calculates the size of an HTML element and updates it when it changes.

  • Type Parameters

    • T extends HTMLElement

      The type of the HTML element.

    • Size extends ISize = ISize

      The interface defining the size object type.

    Parameters

    • options: Partial<IParams<Size>> = {}

      The optional parameters for the useElementSize function.

    Returns {
        elementRef: RefObject<T>;
        size: Size;
    }

    • An object containing a ref to the element and the current size.
    • elementRef: RefObject<T>
    • size: Size