Lynx

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.