Skip to main content

useActionField

Field hook to get a callback which executes a given action provided by a plugin.

Arguments

The hook can take an object as argument with the following properties.

FieldTypeDescription
fieldstringThe name of the field

Returns

A callback which executes a given action.

Example

src/widgets/example/Example.tsx
import React from 'react'
import {useActionField} from '@modbros/dashboard-sdk'

export default function Example() {
const action = useActionField({field: 'example'})

return <button onClick={action}>execute me</button>
}