undefined when reading the variable of an input in reacstrap

1

I'm trying to access the variable of input called name but it throws undefined . How can I access the data of input of reactstrap?

Any ideas? This is my code:

handleSubmit(e){
  e.preventDefault();
  console.log(this.name);
} 

<form onSubmit={this.handleSubmit}>
  <Input  ref={(input) => (this.name= input)} type="text" value={this.state.value} onChange={this.handleChange} />
  <Button color="info"  >Add</Button></td>
</form>
    
asked by Minniek 19.11.2017 в 16:25
source

0 answers