React · Middle · Question 29 of 75
What does useActionState give you in React 19?
- ✓Correct answer: The form action's result and an
isPendingflag - 2A global store of all actions, like Redux
- 3A history of all state changes for debugging in DevTools
Explanation
const [state, formAction, isPending] = useActionState(action, initialState). The action function receives the previous state and FormData, and its result becomes the new state - handy for validation errors. formAction is passed to <form action>. It works with Server Functions too.