Created
October 3, 2019 01:09
-
-
Save kaievns/828371cb298feb7750282994b3d0085b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { Form } from 'forms-kit' | |
import { ValidationError } from 'a-plus-forms' | |
const OurForm = ({ onSubmit, defaultValues }) => { | |
<Form onSubmit, dfeaul> | |
... | |
} | |
const PageContainer = () => { | |
const [addLink] = useMutation(blargh) | |
const onSubmit = async ({ url, label }) => { | |
if (itSADupe(url, label)) { | |
throw new ValidationError('`url` is a dupe!'); | |
} else { | |
return addLink({ variables: { url, lable }); | |
} | |
} | |
return <Form onSubmit, defaultValue /> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment