iammatthias / com

Digital garden built using Astro, Obsidian, and other goodies.
https://iammatthias.com
222 stars 36 forks source link

build(deps): bump react-hook-form from 7.22.5 to 7.24.0 #180

Closed dependabot[bot] closed 2 years ago

dependabot[bot] commented 2 years ago

Bumps react-hook-form from 7.22.5 to 7.24.0.

Release notes

Sourced from react-hook-form's releases.

Version 7.24.0

🧠 close #6425 memorise useController prop: onChange onBlur and ref (#7526) 📛 related #7521 include name check with resetField (#7521) 🪝 close #7518 making value update before custom onChange (#7519) 🐞 fix #7256 setValue with shouldDirty and shouldTouch combine not update state correctly (#7508)

Version 7.23.0

Happy new year 2022!

💻 Feature/avoid omitting key name use field array (improve DX) (#7301)

const App = () => {
  const { control, register, handleSubmit } = useForm<FormValues>({
    defaultValues: {
      test: [{id: 'UUID5678', test: 'data' }] // id will be remained as it match default keyName
    }
  });
  const { fields, append } = useFieldArray({
    control,
    name: 'test',
  });

return ( <form> {fields.map((field, index) => { return <input key={field.id} {...register(test.${index}.test)} />; })}

  &lt;button
    type={'button'}
    onClick={() =&gt; {
      append({
        id: 'UUID1234', // id value will be remained as it match default keyName
        test: '1234',
      });
    }}
  &gt;
    append
  &lt;/button&gt;
&lt;/form&gt;

); };

📲 apply useCallback for callback function to improve perf (#7378) 🐷 test coverage for types (#7311) 🐎 improve useFieldArray performance with separate id state (#7447) 🎩 close #6776 improve register to support shadow roots (#7400) 📇 fix type infer with UseFormHandleSubmit (#7405) 🎐 remove resolutions dep and update packages (#7396) 🎼 import type for utility

... (truncated)

Changelog

Sourced from react-hook-form's changelog.

[7.24.0] - 2022-1-14

  • useController return prop: onChange, onBlur and ref will be memorized with useCallback

[7.23.0] - 2022-1-12

Changed

  • useFieldArray change keyName is no longer required when field value contains id
const App = () => {
  const { control, register, handleSubmit } = useForm<FormValues>({
    defaultValues: {
      test: [{ id: 'UUID5678', test: 'data' }], // id value will be retained
    },
  });
  const { fields, append } = useFieldArray({
    control,
    name: 'test',
  });

return ( <form> {fields.map((field, index) => { return <input key={field.id} {...register(test.${index}.test)} />; })}

  &lt;button
    type={'button'}
    onClick={() =&gt; {
      append({
        id: 'UUID1234', // id value will be retained
        test: '1234',
      });
    }}
  &gt;
    append
  &lt;/button&gt;
&lt;/form&gt;

); };

  • useFormState will no longer fire state update after hook unmount
  • UseFormHandleSubmit type will infer formValues

[7.22.0] - 2021-12-14

Changed

... (truncated)

Commits
  • 0c62f3c 7.24.0
  • 1d62c7a 🥼 update changelog 7.24.0
  • 42d995b 🧠 close #6425 memorise useController props (#7526)
  • 9a33cfd 📛 related #7521 include name check with resetField (#7521)
  • 981410c 🪝 close #7518 making value update before custom onChange (#7519)
  • 7a21f03 🥼 update changelog v7.23.0
  • c1d7731 ❤️ thank you moshyfawn support the community
  • 124e00f 🐞 fix #7256 setValue with shouldDirty and shouldTouch combine not update stat...
  • 964a793 7.23.0
  • cf2c633 🥌 improve useFormState with mounted ref to skip update when hook is unmounted...
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
dependabot[bot] commented 2 years ago

Looks like react-hook-form is up-to-date now, so this is no longer needed.