Skip to content

Instantly share code, notes, and snippets.

@lucas-lm
Created March 7, 2020 01:40
Show Gist options
  • Save lucas-lm/043d24538052fdb9e55cc752c45a66a8 to your computer and use it in GitHub Desktop.
Save lucas-lm/043d24538052fdb9e55cc752c45a66a8 to your computer and use it in GitHub Desktop.
Submit button component for React based on Material-UI for formik's forms
import React from 'react'
import Button from '@material-ui/core/Button'
import { useFormikContext } from 'formik'
const SubmitButton = props => {
const { isSubmitting } = useFormikContext()
const { type, ...rest } = props
return <Button type='submit' disabled={isSubmitting} {...rest}/>
}
export default SubmitButton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment