Skip to content

Instantly share code, notes, and snippets.

@suzdalnitski
Created September 4, 2018 01:51
Show Gist options
  • Save suzdalnitski/8c4050fc05a62d82fdfe35f651f30120 to your computer and use it in GitHub Desktop.
Save suzdalnitski/8c4050fc05a62d82fdfe35f651f30120 to your computer and use it in GitHub Desktop.
...
import TextField from './TextField';
class SimpleForm extends React.Component {
...
render() {
const { firstNameError, firstName, lastName, lastNameError } = this.state;
return (
<div style={style.form}>
<TextField name="firstName"
label="First name:"
onChange={this.onFirstNameChange}
onBlur={this.onFirstNameBlur}
error={firstNameError} />
<TextField name="lastName"
label="Last name:"
onChange={this.onLastNameChange}
onBlur={this.onLastNameBlur}
error={lastNameError} />
<Greetings firstName={firstName} lastName={lastName} />
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment