jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.9k stars 2.79k forks source link

Feature: Pass Yup context to validationSchema using new prop validationSchemaContext in <Formik> #3852

Open john-raymon opened 1 year ago

john-raymon commented 1 year ago

Closes #3450

https://github.com/jaredpalmer/formik/blob/ccdcb3979a0ca7de99e017a544fcaee3ef7e5936/packages/formik/src/Formik.tsx#L230-L241

Note the validateYupSchema function already had an optional context argument, and it also already had a third argument called sync 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-L1091

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

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.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **formik-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/formik/formik-docs/9iSnLxsH6hFPo4DpFD1PHE4ZChn2)) | [Visit Preview](https://formik-docs-git-fork-john-raymon-new-yup-context-e676fa-formik.vercel.app) | | Aug 1, 2023 5:58am |
codesandbox-ci[bot] commented 1 year ago

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
mikegreiling commented 6 months ago

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 :(

Cbridger-mywellabee commented 3 months ago

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!

yogiduzit commented 2 months ago

+1, would appreciate this PR's prioritization.