Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Created September 3, 2018 14:34
Show Gist options
  • Select an option

  • Save agoiabel/dd57edf641c21de7cb1f7af0d17aaa5d to your computer and use it in GitHub Desktop.

Select an option

Save agoiabel/dd57edf641c21de7cb1f7af0d17aaa5d to your computer and use it in GitHub Desktop.
import React from 'react';
const Email = props => {
let formControl = "form-control";
if (props.touched && !props.valid) {
formControl = 'form-control control-error';
}
return (
<div className="form-group">
<input type="email" className={formControl} {...props} />
</div>
);
}
export default Email;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment