0.0.2 • Published 11 months ago

use-action-state v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

use-action-state

A react hook that simplifies usage of react server actions. The hook adds error handing and loading states.

Example

const [run, { error, loading }] = useActionState(action);

...

await run()

Full API

const [run, { error, loading, data }] = useActionState(action);

...

const { data, error } = await run()

Installation

yarn add use-action-state
npm install use-action-state
0.0.2

11 months ago

0.0.1

11 months ago