Skip to content

Instantly share code, notes, and snippets.

@cbrannen9a
Created November 8, 2018 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cbrannen9a/6b5c66dafe35a565ac9afd272b12d04a to your computer and use it in GitHub Desktop.
Save cbrannen9a/6b5c66dafe35a565ac9afd272b12d04a to your computer and use it in GitHub Desktop.
Partial Address Form with error and helperText
function AddressForm(props) {
const { state, handleChange } = props;
return (
<Fragment>
<Typography variant="h6" gutterBottom>
Shipping address
</Typography>
<Grid container spacing={24}>
<Grid item xs={12} sm={6}>
<TextField
required
id="firstName"
name="firstName"
label="First name"
fullWidth
autoComplete="fname"
value={state.addressForm.firstName}
onChange={handleChange('firstName', 'addressForm')}
error={!state.validation.firstName}
helperText={state.validation.errorTypes.firstName}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment