All Versions
151
Latest Version
Avg Release Cycle
10 days
Latest Release
15 days ago

Changelog History
Page 2

  • v7.8.5 Changes

    June 19, 2021

    ๐Ÿ”„ Change

    • useController no longer access input ref except focus event for focus management
  • v7.8.0 Changes

    โž• Added

    • โšก๏ธ setValue support shouldTouch to update formState touchFields
    setValue('firstName', 'value', { shouldTouch: true });
    
    • register now accept value as option
    register('firstName', { value: 'value' });
    
  • v7.7.1 Changes

    May 30, 2021

    ๐Ÿ›  Fixed

    • ๐Ÿ”€ shouldUnregister: false should not shallow merge or register absent input fields from defaultValues
  • v7.7.0 Changes

    May 29, 2021

    โž• Added

    • ๐Ÿ‘ trigger support focus with error input
    trigger('inputName', { shouldFocus: true });
    

    ๐Ÿ”„ Changed

    • handleSubmit will throw error within the onSubmit callback
  • v7.6.0 Changes

    May 15, 2021

    ๐Ÿ”„ Changed

    • 0๏ธโƒฃ useForm will register missing inputs from defaultValues
    const App = () => {
      const { register, handleSubmit } = useForm({
        defaultValues: {
          test: { firstName: 'bill', lastName: 'luo' },
        },
      });
    
      const onSubmit = (data) => {
        // missing registered input will be included
        console.log(data); // { test: { firstName: 'bill', lastName: 'luo' } }
      };
    
      return (
        <form onSubmit={handleSubmit(onSubmit)}>
          <input {...register('test.firstName')} />
          <button />
        </form>
      );
    };
    
  • v7.5.0 Changes

    May 09, 2021

    ๐Ÿ”„ Changed

    • isSubmitSuccessful will return false when handleSubmit callback failed with Error or Promise reject.
    • unmounted input will no longer get validated even with shouldUnregister: false
  • v7.4.0 Changes

    May 04, 2021

    โž• Added

    • ๐Ÿ†• new name prop for useFormState to subscribe to individual inputs.
    useFormState({
      name: 'inputName', // optional and can be array of inputs' name as well
    });
    
  • v7.2.2 Changes

    April 21, 2021

    ๐Ÿ”„ Changes

    • ๐Ÿ”€ set shouldUnregister to true will not shallow merge defaultValues
  • v7.2.0 Changes

    April 19, 2021

    ๐Ÿ”„ Changes

    • ๐Ÿšš shouldUnregister config to remove input value after unmount
    // Global config (can't be overwrite)
    useForm({
      shouldUnregister: true // default to false
    })
    
    // Component/Hook level config (can not overwrites global cocnfig)
    register('test', {
      shouldUnregister: true // default to false
    })
    
    <Controller  shouldUnregister={true} />
    
    useController({ shouldUnregister: true })
    
    useFieldArray({ shouldUnregister: true })
    
  • v7.0.6 Changes

    April 12, 2021

    ๐Ÿ”„ Changes

    • register will retrieve onChange's target value when component'ref is not a valid input element.