# How to (not) reset a form after a Server Action in React

DevFeed: [How to (not) reset a form after a Server Action in React](<https://devfeed.tech/articles/how-to-not-reset-a-form-after-a-server-action-in-react-18975.md>)

Original publisher: [Read original article](<https://www.robinwieruch.de/react-server-action-reset-form/>)

Author: Robin Wieruch

Published: 2024-11-04T06:50:46Z

Content type: tutorial

Language: en

Sources: [Robin Wieruch](<https://devfeed.tech/sources/robin-wieruch.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [Next.js](<https://devfeed.tech/topics/next-js.md>), [User Experience](<https://devfeed.tech/topics/user-experience.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [experience](<https://devfeed.tech/tags/experience.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [learn](<https://devfeed.tech/tags/learn.md>), [next-js](<https://devfeed.tech/tags/next-js.md>), [react](<https://devfeed.tech/tags/react.md>), [react-server-action-reset-form](<https://devfeed.tech/tags/react-server-action-reset-form.md>), [state](<https://devfeed.tech/tags/state.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [validation](<https://devfeed.tech/tags/validation.md>)

## AI overview

This tutorial explains how React forms using Server Actions reset automatically after submission, including when an action fails. It shows how to preserve the entered form data after validation or database errors while retaining the normal reset behavior for successful submissions, using React and Next.js.

## Source excerpt

Learn how not to reset a form after a erroneous server action in React. In other words, how to opt-out of the default form reset behavior in React ...