useAction function returns a callback that allows components to trigger named actions with optional props. This enables communication between BindJS components and the host application.
Parameters
NoneReturns
Returns an action dispatch function that accepts an options object:name- The name of the action to triggerprops- Optional properties to pass with the action
Usage
Basic action dispatch
Action with props
Analytics or tracking events
Open external links
Notes
- The actual action handling depends on the host application or runtime environment
- Actions are typically used for communication between BindJS components and native code
- Common use cases include analytics, deep linking, opening URLs, and triggering native functionality
- The host application must register action handlers to respond to dispatched actions
See Also
- useState - Manage component state
- useEnvironment - Access environment values
