Open john-raymon opened 1 year ago
Latest commit: 2ef7ef601736c9ab12ce475462ddcde2abd8ddaf
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 2ef7ef601736c9ab12ce475462ddcde2abd8ddaf:
Sandbox | Source |
---|---|
Formik TypeScript Playground (forked) | Configuration |
What can be done to move this PR forward? I could really use this feature and I'd be happy to contribute, but it looks like this has gone 8 months with no feedback from code owners :(
I just ripped out RHF and replaced it with Formik because RHF doesn't support errors being raised on fields that weren't touched (although it supported contexts!), only to find out Formik doesn't currently support Yup Contexts 😅, I would love it if this PR could gain some momentum!
+1, would appreciate this PR's prioritization.
Chiming in as this is an issue my team faces regularly
Closes #3450
<Formik>
component calledvalidationSchemaContext
for Yup context, which is then passed to the validationSchema here (see below):https://github.com/jaredpalmer/formik/blob/ccdcb3979a0ca7de99e017a544fcaee3ef7e5936/packages/formik/src/Formik.tsx#L230-L241
Note the
validateYupSchema
function already had an optionalcontext
argument, and it also already had a third argument calledsync
which is set to default to false in the function definition. , no changes were made below. (see below) https://github.com/jaredpalmer/formik/blob/ccdcb3979a0ca7de99e017a544fcaee3ef7e5936/packages/formik/src/Formik.tsx#L1079-L1091Wrote tests in both
Formik.test.tsx
and inyupHelpers.test.ts
.Added types for the new prop.
Updated the docs to include the new prop in the
<Formik>
api page