diff --git a/content/blog/gotchas-with-react-hook-form/index.md b/content/blog/gotchas-with-react-hook-form/index.md new file mode 100644 index 0000000..45c12db --- /dev/null +++ b/content/blog/gotchas-with-react-hook-form/index.md @@ -0,0 +1,10 @@ +--- +title: Gotchas with React Hook Form +author: Nick Bernard +date: 2022-07-12T20:49:05.318Z +description: Learn how to avoid some common pitfalls with the popular form library +--- +* setValue does not dirty or revalidate the field by default +* A form can be dirty when \`dirtyFields\` is empty: https://github.com/react-hook-form/react-hook-form/issues/4740 +* The watch API points to a reference of the form data, not an immutable copy +* setValue is very slow; use insert/replace/delete \ No newline at end of file