rickhanlonii · GitHub

Conversation

@vercel

hernan-yadiel

hernan-yadiel

hernan-yadiel

hernan-yadiel

hernan-yadiel

hernan-yadiel

hernan-yadiel

hernan-yadiel

MaxwellCohen

hernan-yadiel

hernan-yadiel

hernan-yadiel

aurorascharff

stephan-noel


- **Use `useActionState`** to manage state of your Actions. The reducer can perform side effects.

You can think of `useActionState` as `useReducer` for side effects from user Actions. Since it computes the next Action to take based on the previous Action, it has to [order the calls sequentially](/reference/react/useActionState#how-useactionstate-queuing-works). If you want to perform Action in parallel, use `useState` and `useTransition` directly.

@vercel

@vercel

…tate

@vercel

@vercel

icyJoseph

hernan-yadiel

stephan-noel

@vercel

@rickhanlonii

@aurorascharff

@rickhanlonii

icyJoseph

}
```

Alternatively, you can add a `key` prop to the component using `useActionState` to force it to remount with fresh state, or a `<form>` `action` prop, which resets automatically after submission.

Read the original on github.com ↗