Skip to content

Releases: jaredpalmer/formik

formik@2.3.2

26 May 20:42
9edb25f

Choose a tag to compare

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

26 May 19:47
b12aad7

Choose a tag to compare

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(),
      }),
      object2: Yup.object({
        // this works because of the "context" feature, enabled by $ prefix
        nestedFieldWithRef: Yup.number()
          .min(0)
          .max(Yup.ref('$object.nestedField')),
      }),
    });

    With this change, you may now validate against any field in the entire schema,
    regardless of position when using the \$ prefix.

formik@2.2.10

26 May 19:30
d3348d2

Choose a tag to compare

Patch Changes

  • 22e236e #3784 Thanks @probablyup! - Improve performance of the FieldArray component by adding a shouldComponentUpdate check; this should help avoid unnecessary re-renders which may affect the performance of a form.

  • bc9cb28 #3785 Thanks @probablyup! - Fixed field error state for array fields that have an error and become empty through an API like arrayHelpers.remove.

    The prior behavior resolved the field error to [undefined], now it is simply undefined.

  • 9cbf150 #3787 Thanks @probablyup! - Fix infinite loop issue in Field when field helpers (setTouched, etc) are used as an argument in React.useEffect.

  • 9c75a9f #3780 Thanks @probablyup! - Fixed an issue with array field errors being incorrectly split into an array of individual characters instead of an array of error strings.

  • 35fa4cc #3783 Thanks @probablyup! - Fix validation of deep.dot.path field references when using the validateField API.

formik-native@2.1.21

26 May 20:42
9edb25f

Choose a tag to compare

Patch Changes

formik-native@2.1.19

26 May 19:47
b12aad7

Choose a tag to compare

Patch Changes

formik-native@2.1.18

26 May 19:30
d3348d2

Choose a tag to compare

Patch Changes

formik@2.2.9

02 Jun 17:04
903c110

Choose a tag to compare

Patch Changes

formik-native@2.1.17

02 Jun 17:04
903c110

Choose a tag to compare

Patch Changes

  • Updated dependencies [ca60ef9]:
    • formik@2.2.9

formik@2.2.8

21 May 23:59
2bfa592

Choose a tag to compare

Patch Changes

  • 3a9c707 #3203 Thanks @hixus! - Fixes type of setError value as it is same as setFieldError message

formik-native@2.1.16

21 May 23:59
2bfa592

Choose a tag to compare

Patch Changes

  • Updated dependencies [3a9c707]:
    • formik@2.2.8