Skip to content

Instantly share code, notes, and snippets.

@asouza
Created November 23, 2019 12:29
Show Gist options
  • Save asouza/0378fb445abcecca40538c3c285f0545 to your computer and use it in GitHub Desktop.
Save asouza/0378fb445abcecca40538c3c285f0545 to your computer and use it in GitHub Desktop.
<Form onSubmit={handleSubmit} subscription={{ submitting: true }} validate={validate}>
{({ handleSubmit2, submitting }) => (
<form onSubmit={handleSubmit2} className={classes.form} noValidate>
<Field
autoComplete="email"
autoFocus
component={RFTextField}
disabled={submitting || sent}
fullWidth
label="Email"
margin="normal"
name="email"
required
size="large"
/>
<Field
fullWidth
size="large"
component={RFTextField}
disabled={submitting || sent}
required
name="password"
autoComplete="current-password"
label="Password"
type="password"
margin="normal"
/>
<FormSpy subscription={{ submitError: true }}>
{({ submitError }) =>
submitError ? (
<FormFeedback className={classes.feedback} error>
{submitError}
</FormFeedback>
) : null
}
</FormSpy>
<FormButton
className={classes.button}
disabled={submitting || sent}
size="large"
color="secondary"
fullWidth
>
{submitting || sent ? 'In progress…' : 'Sign In'}
</FormButton>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment