Skip to content

Bump formik from 2.2.9 to 2.4.0

dependabot requested to merge dependabot-npm_and_yarn-formik-2.4.0 into main

Bumps formik from 2.2.9 to 2.4.0.

Release notes

Sourced from formik's releases.

formik@2.4.0

Minor Changes

formik@2.3.3

Patch Changes

  • f075a0c #3798 Thanks @​probablyup! - Fixed the use of generics for the ArrayHelpers type such that any[] is the default array type and for each individual method the array item type can be overridden if necessary.

formik@2.3.2

Patch Changes

  • f086b5a #3237 Thanks @​pieplu! - Changed getIn to return undefined when it can't find a value AND a parent of that value is "falsy" ( "" / 0 / null / false )

  • 6d8f018 #3792 Thanks @​probablyup! - Update the type for setFieldValue to reflect the returned Promise and potential returned error(s).

formik@2.3.0

Minor Changes

  • 73de78d #3788 Thanks @​probablyup! - Added typescript generics to ArrayHelpers interface and its methods so that users who use TypeScript can set the type for their arrays and have type safety on array utils. I have also gone ahead and made supplying a type for the generic optional for the sake of backwards compatibility so any existing TS code that does not give a type for the FieldArray will continue to work as they always have.

  • 39a7bf7 #3786 Thanks @​probablyup! - Yup by default only allows for cross-field validation within the same field object. This is not that useful in most scenarios because a sufficiently-complex form will have several yup.object() in the schema.

    const deepNestedSchema = Yup.object({
      object: Yup.object({
        nestedField: Yup.number().required(),
      }),
      object2: Yup.object({
        // this doesn't work because `object.nestedField` is outside of `object2`
        nestedFieldWithRef: Yup.number()
          .min(0)
          .max(Yup.ref('object.nestedField')),
      }),
    });

    However, Yup offers something called context which can operate across the entire schema when using a \$ prefix:

    const deepNestedSchema = Yup.object({
      object: Yup.object({
        nestedField: Yup.number().required(),

... (truncated)

Commits


Dependabot commands
You can trigger Dependabot actions by commenting on this MR
  • $dependabot rebase will rebase this MR
  • $dependabot recreate will recreate this MR rewriting all the manual changes and resolving conflicts

Merge request reports

Loading