From f507e189317110888721076cdc2f4560cf1ecc5a Mon Sep 17 00:00:00 2001 From: Nick Bernard Date: Tue, 12 Jul 2022 21:25:01 +0000 Subject: [PATCH] =?UTF-8?q?Create=20Blog=20=E2=80=9Cgotchas-with-react-hoo?= =?UTF-8?q?k-form/index=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/blog/gotchas-with-react-hook-form/index.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 content/blog/gotchas-with-react-hook-form/index.md 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