Skip to content

A react hook that simplifies usage of react server actions

Notifications You must be signed in to change notification settings

henninghall/use-action-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A react hook that simplifies usage of react server actions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published