• Attach any Hydrateless enhancer to a DOM node for the lifetime of a component. Returns a ref to spread onto the element you want enhanced plus a ref to the enhancer's imperative API (e.g. setValue/setOpen). The instance is destroyed automatically on unmount (and before re-running when deps change), so there are no leaked listeners across renders.

    const { ref, api } = useEnhancer<HTMLDivElement, TabsApi>((el) => enhanceTabs(el));
    // api.current?.setValue('two');
    return <div data-hl-tabs ref={ref}></div>;

    Type Parameters

    • T extends HTMLElement = HTMLElement
    • Api = null

    Parameters

    Returns { api: RefObject<null | Api>; ref: RefObject<null | T> }