A react hook that simplifies usage of react server actions. The hook adds error handing and loading states.
const [run, { error, loading }] = useActionState(action);
...
await run()
const [run, { error, loading, data }] = useActionState(action);
...
const { data, error } = await run()
yarn add use-action-state
npm install use-action-state