Created
November 8, 2018 12:04
-
-
Save cbrannen9a/6b5c66dafe35a565ac9afd272b12d04a to your computer and use it in GitHub Desktop.
Partial Address Form with error and helperText
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
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