All Versions
177
Latest Version
Avg Release Cycle
10 days
Latest Release
603 days ago

Changelog History
Page 13

  • v4.9.1 Changes

    February 09, 2020

    ๐Ÿฑ ๐ŸŽฎ feature/support custom schema validation (#974)

    import React from "react";
    import { useForm } from "react-hook-form";
    import Joi from "@hapi/joi";
    
    const validationSchema = Joi.object({
      username: Joi.string().required()
    });
    
    const resolver = (data: any, validationContext) => {
      const { error, value: values } = validationSchema.validate(data, {
        abortEarly: false
      });
    
      return {
        values: error ? {} : values,
        errors: error
          ? error.details.reduce((previous, currentError) => {
              return {
                ...previous,
                [currentError.path[0]]: currentError
              };
            }, {})
          : {}
      };
    };
    
    export default function App() {
      const { register, handleSubmit, errors } = useForm({
        validationResolver: resolver,
        validationContext: { test: "test" }
      });
    
      return (
        <form onSubmit={handleSubmit(d => console.log(d))}>
          <input type="text" name="username" ref={register} />
          <input type="submit" />
        </form>
      );
    }
    

    ๐Ÿฑ ๐Ÿž close #954 fix type for ErrorMessage component props (#966)
    ๐Ÿฑ ๐Ÿž fix #967 issue around getValues with defaultValues (#968)
    ๐Ÿฑ ๐Ÿž fix #969 fields compare function
    ๐Ÿฑ โœŒ๏ธ close #951 include keyName prop for custom id (#957)
    โœŒ๐Ÿป improve type keyName for useFieldArray (#983)
    ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป improve type for ref (#990)
    ๐Ÿฑ ๐Ÿ’‰ fix #988 isValid form state with useFieldArray schema (#991)
    ๐Ÿฑ โ› fix #994 prevent useFieldArray items unregister (#995)
    ๐Ÿฑ โŒจ๏ธ useFieldArray remove method support array of indexes (#980)
    ๐Ÿ‘Œ support remove([1,2,3])

  • v4.9.0

    February 09, 2020
  • v4.8.2 Changes

    February 03, 2020
    • ๐Ÿ›  fix issue around watch API with nest set to true
  • v4.8.1 Changes

    February 03, 2020

    ๐Ÿฑ ๐Ÿž fix #670 reset empties the input
    ๐Ÿฑ ๐Ÿž fix #956 react native FileList not defined
    ๐Ÿฑ ๐Ÿž fix #955 field array dirty value compare
    ๐Ÿฑ ๐Ÿ›€ Remove deprecated field from options type. (#952)

  • v4.8.0 Changes

    January 31, 2020

    ๐ŸŽ ๐Ÿ close #938 performance enhancement for watch (#939)
    ๐Ÿฑ ๐Ÿ•บ improve #938 watch perf with search array (#946)
    ๐Ÿฑ ๐Ÿ‘จโ€๐Ÿš’ fix #932 issue around delete file list object in FF (#944)
    ๐Ÿฑ ๐Ÿ‘‘ support rest props for ErrorMessage component (#941)

    <ErrorMessage className="test" onClick={() => {}} errors={errors} name="test" />
    

    ๐Ÿฑ โœŒ๏ธ assign non-object values to value property (#940)
    ๐Ÿฑ ๐Ÿž fix mutationWatcher in remove event listener function
    ๐Ÿฑ ๐Ÿคž #924 improvement over watch with field array (#930)

  • v4.7.3-next.0 Changes

    January 30, 2020
    • get watch() API to work with
    • ๐Ÿ›  fix errors and touched fields position with useFieldArray
  • v4.7.2 Changes

    January 29, 2020

    ๐Ÿฑ ๐Ÿž fix #927 formState read flag (#929)
    ๐Ÿฑ ๐Ÿฅ‚ support register method with optional first argument for useFieldArray
    ๐Ÿฑ ๐Ÿฅ‚ add support for array values in useFieldArray methods (#925)
    ๐Ÿฑ ๐Ÿฅ‚ ErrorMessage support message prop

    eg:

    โœ… <ErrorMessage errors={errors} name="test" message="message here" />

  • v4.7.2-next.0

    January 29, 2020
  • v4.7.1 Changes

    January 26, 2020

    ๐Ÿฑ ๐Ÿž patch on remove api with last item (#909)

  • v4.7.0 Changes

    January 25, 2020

    ๐Ÿฑ ๐Ÿ˜ญ fix use field array (#896)

    • โœ‚ remove mapID of each render
      IMPORTANT: for native input you will have to use register({}) to trigger ref callback
    • ๐Ÿ›  fix errors got removed after remove item
    • ๐Ÿ›  fix delete issue
    • ๐Ÿ›  fix dirty value
    • ๐Ÿ›  fix async reset with dirty value

    ๐Ÿฑ ๐Ÿž fix #903 errors type object comparison (#907)
    ๐Ÿฑ ๐Ÿž fix(Controller): Invoke onBlur method when mode is onBlur. (#902)
    ๐Ÿฑ ๐Ÿž fix #890 radio dynamic inject issue (#901)
    ๐Ÿฑ ๐Ÿž fix #893 trigger validation (#900)
    ๐Ÿฑ ๐Ÿž fix #881 issue around formState with reset (#891)
    ๐Ÿฑ ๐ŸŽ‰ make handleSubmit event optional (#885)