PHP 8.2.30
Preview: use-action.doc.md Size: 550 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/frontend/hooks/use-action/use-action.doc.md

The hook which allows you to use {@link ActionJSON} to perform actual actions on the backend.
Base on the action type and parameters (like {@link ActionJSON.guard}) it behaves differently.

### Usage

```javascript
import { useAction } from 'adminjs'
import { Button } from '@adminjs/design-system'

const myComponent = ({ action }) => {
  const { href, handleClick } = useAction(action, {
    resourceId, recordId, recordIds,
  }, actionPerformed)

  return (
    <Button as="a" onClick={handleClick} href={href}>Click this action</Button>
  )
}
```

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
121 B lrw-r--r-- 2026-02-28 00:31:44
Edit Download
774 B lrw-r--r-- 2026-02-28 00:31:50
Edit Download
550 B lrw-r--r-- 2026-02-28 00:31:56
Edit Download
1.32 KB lrw-r--r-- 2026-02-28 00:31:50
Edit Download
10 B lrw-r--r-- 2026-02-28 00:31:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).