cytoplasmic
    Preparing search index...

    Function DocumentListener

    • Attach a document listener to the lifecycle of the current Context. The event listener will be removed when the context is destroyed.

      Type Parameters

      • TKey extends keyof DocumentEventMap

      Parameters

      • props: {
            capture?: boolean;
            on: TKey;
            options?: AddEventListenerOptions;
            then: (this: Document, event: DocumentEventMap[TKey]) => void;
        }
        • Optionalcapture?: boolean

          Whether to use event capturing.

        • on: TKey

          Event name.

        • Optionaloptions?: AddEventListenerOptions

          Additional event listener options.

        • then: (this: Document, event: DocumentEventMap[TKey]) => void

          Event handler.

      Returns Element

      <DocumentListener on='keydown' then={e => handleKeydownEvent(e)}/>