Typescript / autocompletion improvements:
- Improve type-safety of
useCondition([...paths], conditions, getValues, control)
hook by narrowingpaths
to only field paths associated withconditions
, not any field path associated with the form.
This improves editor autocompletion and type safety. - If a path is ever provided to
useCondition()
that is is not able to find a condition for, log a warning in the console.
This should always be accompanied by a type error (above), but is a good safeguard so thatuseCondition()
never fails silently.
Full Changelog: v0.1.1...v0.1.2