Skip to content

Latest commit

 

History

History
213 lines (123 loc) · 13.4 KB

CHANGELOG.md

File metadata and controls

213 lines (123 loc) · 13.4 KB

formik

2.4.6

Patch Changes

  • f57ca9b #3949 Thanks @DeveloperRaj! - Changing the state inside formik was changing reference of initialValues provided via props, deep cloning the initialvalues will fix it.

2.4.5

Patch Changes

  • d7db9cd #3860 Thanks @patik! - Add missing dependency @types/hoist-non-react-statics, closes #3837

2.4.4

Patch Changes

  • 41720c2 #3862 Thanks @yazaldefilimonepinto! - Forward className for custom components used with Field

  • da58b29 #3858 Thanks @alaanescobedo! - Remove use of deprecated StatelessComponent type in favor of FunctionComponent

  • 5c01ee7 #3872 Thanks @rajpatelbot! - FIX: Fixed resetForm function dependency issue

2.4.3

Patch Changes

2.4.2

Patch Changes

2.4.1

Patch Changes

  • 708bcb2 #3813 Thanks @quantizor! - Revert FieldArray "shouldComponentUpdate" performance optimization. As it turns out, it's a common use case to have JSX controlled via non-Formik state/props inside of FieldArray, so it's not safe to cancel re-renders here.
  • 187e47d #3815 Thanks @quantizor! - Revert Yup transform support for the time being, this may be re-introduced in a future release under an opt-in prop.

2.4.0

Minor Changes

2.3.3

Patch Changes

  • f075a0c #3798 Thanks @quantizor! - 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.

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 @quantizor! - Update the type for setFieldValue to reflect the returned Promise and potential returned error(s).

2.3.1

Patch Changes

  • 290d92b #3793 Thanks @quantizor! - Fix potential infinite loop scenario when initialValues changes but enableReinitialize is not truthy.

2.3.0

Minor Changes

  • 73de78d #3788 Thanks @quantizor! - 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 @quantizor! - 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.

2.2.10

Patch Changes

  • 22e236e #3784 Thanks @quantizor! - 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 @quantizor! - 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 @quantizor! - Fix infinite loop issue in Field when field helpers (setTouched, etc) are used as an argument in React.useEffect.
  • 9c75a9f #3780 Thanks @quantizor! - 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 @quantizor! - Fix validation of deep.dot.path field references when using the validateField API.

2.2.9

Patch Changes

2.2.8

Patch Changes

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

2.2.7

Patch Changes

  • 31405ab #3201 Thanks @artola! - Fixes regression that resulted in error update race condition from when using validateOnMount
  • c2d6926 #2995 Thanks @johnrom! - Allow explicitly setting <form action> to empty string (#2981). Note: previous code which passed an empty string would result in a noop (simply appending # to the url), but this will now result in a form submission to the current page.

2.2.6

Patch Changes

2.2.5

Patch Changes

2.2.4

Patch Changes

2.2.3

Patch Changes

2.2.2

Patch Changes

2.2.1

Patch Changes

  • e04886d #2820 Thanks @wellyshen! - Fixed bug with scheduler and validateFormWithLowPriority method not be scheduled correctly

2.2.0

Minor Changes

  • 4148181 #2794 Thanks @jaredpalmer! - setValue can now optionally accept a function as a callback, exposing React.SetStateAction functionality. Previously, only the entire object was allowed which caused issues with stale props.

    setValues(prevValues => ({...prevValues, ... }))

2.1.7

Patch Changes