next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

Chapter 14: after form validation, every fields return to it's initial state

Open hyunha95 opened this issue 1 year ago • 1 comments

I am working on 'Edit Invoice' page. https://nextjs.org/learn/dashboard-app/improving-accessibility

Initial state for customer is 'Amy Burns', for amount is '12.5' and for status is 'Paid'.

I change customer to 'Evil Rabbit' and amount to empty.

After submitting my form, amount is validated but suddenly customer value returns to it's initial value which is 'Amy Burns'. And amount value also returns to initial value which is '12.5'.

This is , to me, very strange.

I am wondering that it is a bug or intended.

If it is intended, is there other way that i can avoid this?

hyunha95 avatar Aug 19 '24 04:08 hyunha95

hey @hyunha95

please take a look and try this: https://github.com/vercel/next-learn/issues/845#issue-2484893438

let me know if it works

eiffel205566 avatar Aug 24 '24 22:08 eiffel205566

This means that something is wrong with your database setup, and the state is "resetting" back to the original state

Could you try working backward from the final example?

leerob avatar Jan 15 '25 19:01 leerob