Revalidation Versions Save

Higher Order Component for Validating Forms in React

v0.12.0

6 years ago
  • Added updateErrors and updateAsyncErrors functions (see #41)

  • Updated spected dependency to 0.5 to enable dynamic form field validations (see #26)

  • Added callback capability to onChange to enable accessing validated form values after an onChange update. (see #42)

v0.11.0

6 years ago

Following Changes:

  • validateOnChange : accepts a callback or a boolean value. Useful when needing from static to dynamic validation after an initial submit.

  • validateSingle and validateOnChange are set to false by default now.

  • Added submitted property, boolean value set to true after the initial submit.

  • Added shortcut functions for updating and validating fields:

    • updateValue
    • validateValue
    • updateValueAndValidate
  • Changed asynchronous validation handling. Revalidation doesn't run any asynchronous validations against rules, this has been moved to user land.

  • onSubmit (renamed from validateAll) now runs any callback supplied wether the validation has been successful or not. Passes a calculated valid (boolean) and the complete form state.

    <button
      onClick={() => onSubmit(({form, valid}) => valid ? submitCb(form) : console.log('not valid!'))}
    >
      Submit
    </button>
    

v0.10.0

6 years ago

Following Changes:

  • Added Deep Nested Data capabilities: Enables to update and validate deep nested data.
  • The reValidaiton prop has been renamed to revalidation
  • Added default if initialState is missing.
  • Renamed updateValute to onChange and pending to loading in revalidation
  • Renamed option attribute instantValidation to validateOnChange.