Created
September 3, 2018 08:17
-
-
Save agoiabel/888f77c07aef92664167d0ea5d97e39e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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