If I have just a basic forms, should I still this.refs
or just go with document.getElementById
?
By basic I mean something like:
export default class ForgetPasswordComponent extends React.Component {
constructor(props) {
super(props);
this.handleSendEmail = this.handleSendEmail.bind(this);
}
handleSendEmail(e) {
e.preventDefault();
// this.refs.email.value
// document.getElementById('email').value
}
render() {
<form onSubmit={this.handleSendEmail}>
<input id="email" ref="email" type="text" />
<input type="submit" />
</form>
}
}
Is there a downside into using one over the other?