Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Created September 3, 2018 08:17
Show Gist options
  • Select an option

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

Select an option

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