I am new to react and i think it is a silly question to ask but then too I have a generic input component of text field in which i haven't passed refs and i want to reset the value of text field on button click? Is it possible to clear the value of field on click without passing refs?
handleClick : function(change){
change.preventDefault();
var self=this;
if(this.state.newpwd === this.state.cfmpass){
var pass = {"pwd":self.state.newpwd};
var url = "xyz"
Request.PatchRequest(url,pass,function(response){
self.setState({
authMsg : JSON.parse(response.response).data
});
now how to clear the field value here??
<TextBox type="password"
name="password"
placeholder="Enter new password"
onChange={this.changePwd} />
this is my button on which i want to perform check (which i have done) and after response i want to clear the field value
<Button type="button"
value="Change"
onClick={this.handleClick}/>
TextBox is my generic component.. Any help will be very thankful. Thank you in advance :)