I have a textarea which i'm trying to get value and set to state. but it's working so slowly so i'm typing some thing and i see value after 10-15 second. Why can happened?
my state:
constructor(props) {
super(props);
this.state = {
comment: ''
};
this.getValue = this.getValue.bind(this)
}
my onChange function:
getValue = (e) => {
this.setState({comment: e.target.value})
}
my textarea:
<textarea
type="text"
value={this.state.comment}
onChange={this.getValue}
/>