As described in documentation You need to use controlled input. To make an input – controlled you need to specify two props on it
onChange
– function that would set componentstate
to an inputvalue
every time input is changedvalue
– input value from the componentstate
(this.state.value
in example)
Example:
getInitialState: function() {
return {value: 'Hello!'};
},
handleChange: function(event) {
this.setState({value: event.target.value});
},
render: function() {
return (
<input
type="text"
value={this.state.value}
onChange={this.handleChange}
/>
);
}
More specifically about textarea – here