Best way to reset a form episode artwork

EPISODE · Dec 7, 2021 · 5 MIN

Best way to reset a form

from The Call Kent Podcast · host Kent C. Dodds

This is a question about: Improve the Performance of your React FormsIn the example, submitting the form successfully will still retain the current values of the fields.I want the behavior such that"when the server response says the form is NOT submitted successfully, then the form field will have the current values that has been inputted by the userBut when the server response says that the form is successfully submitted, then the form fields will be blank again.What's do you think is the best and most performant (and readable) code to approach this in pure React? The approach which will reduce the amount of unnecessary rerenders of the fields?Thank you!Updated code sandbox

Episode metadata supplied by the publisher feed · Published Dec 7, 2021

Embed this episode

NOW PLAYING

Best way to reset a form

0:00 5:27

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

No similar podcasts found.

Frequently Asked Questions

How long is this episode of The Call Kent Podcast?

This episode is 5 minutes long.

When was this The Call Kent Podcast episode published?

This episode was published on December 7, 2021.

Can I download this The Call Kent Podcast episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!