Created
September 3, 2018 19:55
-
-
Save suzdalnitski/01e9bffc0dbd6218550ed803171fb722 to your computer and use it in GitHub Desktop.
This file contains 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 style from './style'; | |
class SimpleForm extends React.Component { | |
... | |
render() { | |
const { firstNameError, firstName, lastName } = this.state; | |
return ( | |
<div style={style.form}> | |
<div style={style.inputGroup}> | |
<label> | |
First name: | |
<input | |
style={style.input} | |
type="text" | |
name="firstName" | |
onChange={this.onFirstNameChange} | |
onBlur={this.onFirstNameBlur} | |
/> | |
{firstNameError && ( | |
<div style={style.error}>{firstNameError}</div> | |
)} | |
</label> | |
</div> | |
<Greetings firstName={firstName} lastName={lastName} /> | |
</div> | |
); | |
} | |
} | |
export default SimpleForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment