Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency react-hook-form to v7 #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 2, 2021

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-hook-form (source) 6.10.1 -> 7.6.0 age adoption passing confidence

Release Notes

react-hook-form/react-hook-form

v7.6.0

Compare Source

Changed
  • 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.3

Compare Source

🧠 close #​5162 watch behavior with useFieldArray set to shouldUnregister: true (#​5173)

v7.5.2

Compare Source

⌨️ fix #​5122 type issue with the message (#​5123)

v7.5.1

Compare Source

🐞 fix #​5096 clearErrors with empty arg (#​5098)

v7.5.0

Compare Source

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.2

Compare Source

🐛 fix #​5053 useFormState missing name (#​5058)
🐞 fix #​5051 trigger return with schema (#​5052)

v7.4.1

Compare Source

🐞 fix [v7]: trigger function always returns false #​5043
🐞 fix #​5027 unmounted useFieldArray not remounted with existing values (#​5028)

v7.4.0

Compare Source

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.3.6

Compare Source

⌨️ fix #​4994 typing for watch & getValues (#​5005)
✌🏻 close #​5001 fix unit test errors object issue
👌 fix use form trigger return type (#​5000)

v7.3.5

Compare Source

🐞 fix #​4966 controller input ref gets overwrite (#​4970)
🎉 close #​4988 for parse input value during setValue JS only
💪🏻 improve unregister to info state update (#​4962)

v7.3.4

Compare Source

🐞 fix #​4957 radio/checkbox gets unregistered until all unmounted (#​4959)

v7.3.3

Compare Source

🐞 fix formState gets reset during shouldUnregister: true mode (#​4949)

v7.3.2

Compare Source

🐞 fix #​4947 with missing register options (#​4948)

v7.3.1

Compare Source

Revert "🐛 fix toggle Controller value in useFieldArray (#​4861)" (#​4945)
👻 fix #​4938 issue with watch internal measure against components mounted (#​4939)

v7.3.0

Compare Source

🕺 trigger result validation output (#​4856)

const output = await trigger('fieldName');

🐛 fix toggle Controller value in useFieldArray (#​4861)
🐛 fix #​4912 watch return undefined due to reset (#​4921)
🐞 fix #​4929 input freeze with shouldUnregister: true issue with watch useFieldArray (#​4930)
👻 fix trigger with every filter and update unit tests (#​4937)

v7.2.3

Compare Source

⌨️ fix #​4895 remove incorrect type for validation return messages

v7.2.2

Compare Source

Changes
  • set shouldUnregister to true will not shallow merge defaultValues

v7.2.1

Compare Source

🐞 fix #​4859 issue with reset trigger unregister subscription (#​4860)

v7.2.0

Compare Source

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 config)
register('test', {
  shouldUnregister: true // default to false
})

<Controller  shouldUnregister={true} />

useController({ shouldUnregister: true })

useFieldArray({ shouldUnregister: true })

v7.1.1

Compare Source

🙏🏻 fix register option for register validation inputs (#​4805)
🐞 fix #​4795 isValid not return correctly during onMount useEffect (#​4804)

v7.1.0

Compare Source

✨ close #​4120 useForm setFocus method (#​4623)
🐞 fix #​4772 reset at root level of registered field (#​4784)
🐞 fix #​4762 useWatch deep nested object watch (#​4764)
🐞 fix #​4752 defaultChecked for radio and checkbox (#​4756)

v7.0.7

Compare Source

🐞 update package.json - fix exports (#​4737)
☑️ fix #​4375 inline defaultChecked (#​4736)

v7.0.6

Compare Source

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

v7.0.5

Compare Source

⌨️ fix #​4705 watch type for defaultValue (#​4707)
🐞 fix #​4703 useWatch cache with previous name (#​4706)
👻 close #​4696 with ref callback type error (#​4697)
💪🏻 reduce code check for error object and reduce re-render (#​4689)
🏋🏻‍♀️ move error check file to inline and save size (#​4685)
🐞 fix #​4679 isValid with custom register (#​4684)
🐞 fix #​4665 input file required validation (#​4666)

v7.0.4

Compare Source

🐛 fix 4653 valueAsNumber with required validation (#​4660)
🐛 fix #​4653 by prevent spread primitive data (#​4658)
🤙 close #​4646 useWatch infinite loop (#​4656)
🕹 fix controller's rules type (#​4645)

v7.0.3

Compare Source

🐞 fix #​4627 validate for input number 0 (#​4641)
🐞 fix #​4617 input date type issue with React (#​4640)
🐞 fix #​4637 when reset field array with setValue (#​4639)

v7.0.2

Compare Source

🐞 fix #​4628 useController/controller issue with dirtyFields (#​4635)

v7.0.1

Compare Source

💪🏻 #​4603 Should return boolean value "true" for checkbox that has empty string value of attribute "value" (#​4614)
🐞 fix #​4597 watch intercept dirty return value (#​4612)
🐞 fix #​4599 useController/Controller type check with render prop (#​4600)
💡 refactor: add eslint plugin to sort imports / exports (#​4605)

v7.0.0

Compare Source

Changes
  • change type name from RefCallbackHandler to UseFormRegisterReturn for register callback's return

v6.15.7

Compare Source

🐞 V6: useFieldArray with nested useFieldArray renders with fields

v6.15.6

Compare Source

🐞 fix #​4792 issue with nested field array append

v6.15.5

Compare Source

🐞 fix issue with setInternalValue() for array values (#​4402)
🐞 fix: prevent cloning objects for class-based instances (#​4400)
🐞 fixing Field Array's remove function (#​4389)

v6.15.4

Compare Source

🐞 fix missing key for useFieldArray test
🐞 fix #​4259 correct unset on field array values (#​4262)
🐞 fix #​4260 watch missing type for undefined as the first argument (#​4261)

v6.15.3

Compare Source

🐞 fix #​4251 issue with re-render during unmount field array (#​4252)
🙏🏻 fix: the issue of unmounted component trying to set state after reset for field arrays (#​4150)

v6.15.2

Compare Source

🐞 fix #​4219 Add default values when validating by using resolver (#​4229)
🐞 fix #​4170 by removing field array @​useEffect with shouldUnregister (#​4172)
🐞 fix #​4141 remove prod check at useEffect to fix dev/prod inconsistent behavior (#​4149)

v6.15.1

Compare Source

🐞 fix #​4084 useWatch react with typed value (#​4085)

v6.15.0

Compare Source

Changed
  • radio input default selection will return null instead of empty string ''
  • valueAsNumber with empty input will return NaN instead of 0

v6.14.2

Compare Source

🎯 close #​3908 with nested field value with deep equal (#​3910)
🐞 fix #​3875 with nested useFieldArray remount (#​3900)
🥋 fix #​3850 change method from pop to slice (#​3866)

v6.14.1

Compare Source

🐞 fix #​3851 with invalid formState type (#​3854)
🐞 fix #​3834 dirty fields reset after input unmount with shouldUnregister: false
🐞 fix #​3819 issue with dirty fields during swop action (#​3824)

v6.14.0

Compare Source

Changed
  • setValue without shouldUnregister:false will no longer deep clone its value instead with shallow clone
Added
  • new formState isValidating, this will set to true during validation.
const {
  formState: { isValidating },
} = useForm();

v6.13.1

Compare Source

🐞 fix #​3689 missing id with nested child array (#​3690)
🐞 fix #​3684 issue validate pattern with value as null (#​3685)
📦 close #​3677 improve setValue with field array (#​3688)
🙄 close #​3664 with async useFieldArray remove (#​3665)

v6.13.0

Compare Source

🌟 custom hook: useController (#​3488)

import React from "react";
import { useController } from "react-hook-form";

function Input({ control, name }) {
  const {
    field,
    meta: { invalid, isTouched, isDirty },
  } = useController({
    name,
    control,
    rules: { required: true },
  });

  return <input {...field} />;
}

👨🏻‍💻 fix #​3613 shouldUnregister:false with append deep clone object (#​3614)
🐞 fix #​3617 remove fields from append dep (#​3618)
👨🏻‍💻 close #​3628 reset inconsistency with different shouldUnregister mode (#​3633)
⌨️ fix #​3593 Map type for NestedValue (#​3616)
😿 #​1680 fix unmount warning on dev build (#​3645)
👻 fix #​3651 setValue with shouldUnregister:false with deep clone object (#​3652)
🤖 change from deepClone to shallowClone with defaultValues's reset (#​3607)

v6.12.2

Compare Source

🐞 fix 3577 issue with Controller register at FieldArray (#​3583)
🤜 improve useFieldArray fast refresh (#​3576)
🐞 fix input range max/min validation (#​3575)
🤝 make cloneObject work in both Node & browsers (#​3571)

v6.12.1

Compare Source

🐞 fix controller register issue with field array (#​3561)
🐞 fix fast refresh (#​3559)
🐞 fix #​3539 issue with JSX deepEqual (#​3558)
👨🏻‍💻 improve DX with field array and fast refresh (#​3551)

v6.12.0

Compare Source

Changed
  • When invoking reset({ value }) value will be shallow clone value object which you have supplied instead of deepClone.
// ❌ avoid the following with deep nested default values
const defaultValues = { object: { deepNest: { file: new File() } } };
useForm({ defaultValues });
reset(defaultValues); // share the same reference

// ✅ it's safer with the following, as we only doing shallow clone with defaultValues
useForm({ deepNest: { file: new File() } });
reset({ deepNest: { file: new File() } });
Added
  • New custom hook useController: This custom hook is what powers Controller, and shares the same props and methods as Controller. It's useful to create reusable Controlled input, while Controller is the flexible option to drop into your page or form.
import React from 'react';
import { TextField } from '@&#8203;material-ui/core';
import { useController } from 'react-hook-form';

function Input({ control, name }) {
  const {
    field: { ref, ...inputProps },
    meta: { invalid, isTouched, isDirty },
  } = useController({
    name,
    control,
    rules: { required: true },
    defaultValue: '',
  });

  return <TextField {...inputProps} inputRef={ref} />;
}

v6.11.5

Compare Source

Revert "🔩 defaultValues test cases for useFieldArray (#​3420)" (#​3503)

v6.11.4

Compare Source

🐞 fix #​3482 remove nested dirty fields (#​3486)
👨🏻‍💻 reduce code + fix dirtyFields with field array + improve DX with fast refresh #​1680 (#​3474)
👨🏻‍💻 close #​3642 issue with dev script (#​3463)
👌 use useField internally for Controller (#​3483)

v6.11.3

Compare Source

🐞 fix #​3460 issue with nested schema (#​3461)

v6.11.2

Compare Source

🐞 fix #​3450 append focus index (#​3453)

v6.11.1

Compare Source

🐞 fix #​3440 setError with concurrent isSubmitting (#​3443)
🐞 fix setValue name type and checkbox with shouldUnregister:false (#​3432)
🐞 fix #​3416 date compare (#​3419)
📦 [other] Reduce npm package size (#​3413)
🐞 fix #​3404 reset isValid with resolver (#​3410)
👨🏻‍💻 add warning on ref.current.focus when it is not a function (#​3407)
👨🏻‍💻 close #​3329 useWatch return value to skip extra re-render

v6.11.0

Compare Source

Changed
  • defaultValues is required to measure isDirty, keep a single source of truth to avoid multiple issues raised around isDirty
  • when watch with useFieldArray, fields object is no longer required as defaultValue
- watch('fieldArray', fields);
+ watch('fieldArray');

Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/react-hook-form-7.x branch 7 times, most recently from 08f056d to a0e4cbf Compare April 12, 2021 12:10
@renovate renovate bot force-pushed the renovate/react-hook-form-7.x branch from a0e4cbf to 580ae02 Compare April 14, 2021 10:47
@renovate renovate bot changed the title fix(deps): update dependency react-hook-form to v7 fix(deps): update dependency react-hook-form to v7 - autoclosed Apr 15, 2021
@renovate renovate bot closed this Apr 15, 2021
@renovate renovate bot deleted the renovate/react-hook-form-7.x branch April 15, 2021 12:03
@renovate renovate bot changed the title fix(deps): update dependency react-hook-form to v7 - autoclosed fix(deps): update dependency react-hook-form to v7 Apr 15, 2021
@renovate renovate bot restored the renovate/react-hook-form-7.x branch April 15, 2021 13:07
@renovate renovate bot reopened this Apr 15, 2021
@renovate renovate bot force-pushed the renovate/react-hook-form-7.x branch 5 times, most recently from bc501ba to cc77939 Compare April 22, 2021 03:44
@renovate renovate bot force-pushed the renovate/react-hook-form-7.x branch 6 times, most recently from 01882ec to 77ead4f Compare April 30, 2021 12:59
@renovate renovate bot force-pushed the renovate/react-hook-form-7.x branch 5 times, most recently from 0f9e883 to a10824b Compare May 9, 2021 23:58
@renovate renovate bot force-pushed the renovate/react-hook-form-7.x branch 2 times, most recently from 16b3943 to 4c1d59f Compare May 13, 2021 08:43
@renovate renovate bot force-pushed the renovate/react-hook-form-7.x branch from 4c1d59f to ceb8915 Compare May 15, 2021 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant