Form is resetting after calling onSubmit #1769
-
I dunno why, but my form keeps getting refreshed / reset after I change some values and click the submit button. Even in my onSubmit method I only call
I already tried to migrate all fields to Controllers, then back to simple input fields with Does anyone have an idea why this happens? Using latest stable version.. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Finally I found it... I had some parts of the form extracted into methods like export default function MyForm() {
const TextField = ({name, label, ...props}) {
// render field
}
} after moving them out of my class it works now: const TextField = ({name, label, ...props}) {
// render field
}
export default function MyForm() {
} |
Beta Was this translation helpful? Give feedback.
Finally I found it...
I had some parts of the form extracted into methods like
after moving them out of my class it works now: