I'm starting to use and test React, one of the things that I liked was the possibility to create functions with "dinamic HTML". Actually I'm trying to create a simple notes app, React + PHP, ( https://blog.bitsrc.io/how-to-build-a-contact-form-with-react-js-and-php-d5977c17fec0 ), how can I save the values in the state if i cant use
value={this.state.lname}
onChange={e => this.setState({ lname: e.target.value })}
on my function to print/create Inputs?
function InputH(Name){
var Input = (
<tr>
<th>
<label htmlFor={Name}>{Name}</label>
</th>
<td>
<input type="text" id={Name} name={Name} placeholder={"Your "+Name.toString().toLowerCase()}
value={undefined}
onChange={e => this.setState({ lname: e.target.value })}
/>
</td>
</tr>
);
return Input;
}
Sorry for my noobs question, greetings and thanks.
useStatehook.