Reputation: 3008
I can get the value just fine using:
this.refs.myTextArea.getDOMNode().value
Trying to set that does nothing.
Upvotes: 3
Views: 4147
Reputation: 3334
In even newer version of React ( > v15 ), you don't need findDOMNode()
, this.refs.myTextArea.value =''
is enough
Upvotes: 6
Reputation: 1997
Is the value of your textarea being bind to a state of your component?
If yes then you can't set value like this, what you should do is call setState
to change it.
Upvotes: 0