I have one input which i want to update using ref only(not using setState). constructor(props) { super(props);
this.Increase = this.Increase.bind(this)
this.textInput = React.createRef();
this.state = {
inputVal: -1
};
}
<div>
<input type="number" ref={textInput} placeholder="count"/>
<span onClick={this.Increase}>Increase
</span>
</div>
and i have one function where i want to use to increase input value
Increase(event){
//access ref here and update input value using ref
}
Any help will be appreciated.
Thanks