Skip to content

Instantly share code, notes, and snippets.

@jmlavoier
Last active December 22, 2017 22:34
Show Gist options
  • Save jmlavoier/a2b6fa935b1e1907344c970750514b7e to your computer and use it in GitHub Desktop.
Save jmlavoier/a2b6fa935b1e1907344c970750514b7e to your computer and use it in GitHub Desktop.
<div>
<Field
component={InputField} <!-- component to render -->
type="text" <!-- InputField particular prop -->
name="name" <!-- commom prop for all -->
validate={validateName} <!-- callback function with value -->
value={this.state.name.value} <!-- state value -->
isValid={this.state.name.isValid} <!--state bool isValid -->
onChange={::this.handleChange('name')} <!-- handleChange the state -->
/>
<Field
component={SelectField}
name="sexo"
validate={validateSexo}
value={this.state.sexo.value}
isValid={this.state.sexo.isValid}
options={['masculino', 'feminino']}
onChange={::this.handleChange('sexo')}
/>
<Field
component={TextareaField}
name="about"
validate={validateAbout}
value={this.state.about.value}
isValid={this.state.about.isValid}
onChange={::this.handleChange('about')}
/>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment