What useEnhancer returns: an attachment for the root plus the live API.

interface UseEnhancer<Api> {
    api: null | Api;
    attach: Attachment<HTMLElement>;
}

Type Parameters

  • Api

Properties

Properties

api: null | Api

The enhanced root's imperative API, or null while nothing is attached.

attach: Attachment<HTMLElement>

Attach to the element the enhancer should treat as its container: <div {@attach enhancer.attach}>. Runs the enhancer when the element mounts and destroys it when the element is removed or the options change.