For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /api/genui/openui/functions/useTriggerAction.md.
Lynx
  • English
  • genui / openui / useTriggerAction

    useTriggerAction()

    function useTriggerAction(): (userMessage: string, formName?: string, action?: any) => void | Promise<void>

    Get the triggerAction function for firing structured action events.

    Returns

    Function

    Parameters

    ParameterType
    userMessagestring
    formName?string
    action?any

    Returns

    void | Promise<void>

    Example

    const triggerAction = useTriggerAction();
    <button onClick={() => triggerAction("Submit", "myForm")}>

    Defined in

    @lynx-js/genui/openui/src/core/context.tsx:114

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.