Chapter 14: after form validation, every fields return to it's initial state
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?
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
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?