opengovsg / checkfirst

Don't Know? CheckFirst. A tool to build eligibility checkers and calculators for Singapore Government policies
https://checkfirst.gov.sg
Other
11 stars 6 forks source link

chore(deps): bump react-hook-form from 7.17.5 to 7.18.0 #1201

Closed dependabot[bot] closed 2 years ago

dependabot[bot] commented 2 years ago

Bumps react-hook-form from 7.17.5 to 7.18.0.

Release notes

Sourced from react-hook-form's releases.

Version 7.18.0

๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ฆ schema error parent level look up (#6869)

const validationSchema = object().shape({
  questions: array()
    .min(1, "Array cannot be empty")
    .of(
      object().shape({
        text: string().required("Some text is required")
      })
    )
});

function App() { const { control, formState: { errors }, register } = useForm({ mode: "onChange", resolver: yupResolver(validationSchema), defaultValues: { questions: [ { text: 'test' } ] } }); const { fields, remove } = useFieldArray({ control, name: "questions", }); console.log(errors); return ( <form> {fields.map((question, questionIndex) => ( <div key={question.key}> <input {...register(questions[${questionIndex}].text)} />

      &lt;button type=&quot;button&quot;
        onClick={() =&gt; {
          remove(questionIndex);
        }}
      &gt;
        Remove
      &lt;/button&gt;
    &lt;/div&gt;
  ))}
&lt;/form&gt;

); }

Codesandbox LInk: works with min length parent error object look up

... (truncated)

Commits
  • 872add4 7.18.0
  • 16fbe00 ๐Ÿ˜ž fix #6896 validation isValid mixed with schema result (#6901)
  • d385898 ๐Ÿจ close #6899 trigger isolate render for targeted input name (#6900)
  • b79f0ee ๐Ÿ‘‚ close #6889 disable early subscription with useController (#6890)
  • 7d64501 ๐Ÿž fix #6792 reset with keepDefaultValues (#6886)
  • 2c74a55 ๐Ÿงช test case field array length (#6883)
  • d3be33f โ„ change subject from class to function base to improve readability and reduc...
  • 741c6ab ๐ŸŽณ improve schema validation with field array group error (#6870)
  • 1a19ea7 ๐Ÿ‘‚๐Ÿป make sure subscriptions get unsubscribed after unmount (#6873)
  • ee81cda ๐Ÿ™ƒ recover the missing tests (#6872)
  • 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)