Closed johnkchiu closed 8 years ago
Relevant https://github.com/facebook/react/issues/2533
Based on what I read there:
reset() {
this.setState({ value: { field1: '' } })
}
should work
:+1: That worked. It seems that for textarea, you can't set the value to null
. Empty spaces ''
worked.
Version
Tell us which versions you are using:
Expected behaviour
Bind a button to "reset" form to default values. It works for other inputs EXCEPT textarea.
Actual behaviour
Other input types (e.g. textfield) resets, but the textarea input doesn't.
Steps to reproduce
Stack trace and console log
No error or message in console log.