From f1b50fe051422433bf1b359eb54ed96d10a703ad Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 1 Feb 2022 00:42:49 -0800 Subject: [PATCH] Make new dictionary to make React render on setState --- components/SignupModal/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/SignupModal/index.tsx b/components/SignupModal/index.tsx index 19fdc515..a8846752 100644 --- a/components/SignupModal/index.tsx +++ b/components/SignupModal/index.tsx @@ -49,7 +49,7 @@ const SignupModal = (props: Props) => { const value = event.target.value if (value.length > 0 && errors[name].length == 0) { - const newErrors = errors + const newErrors = {...errors} api.check(name, value) .then((response) => { @@ -109,7 +109,7 @@ const SignupModal = (props: Props) => { event.preventDefault() const { name, value } = event.target - let newErrors = errors + let newErrors = {...errors} switch(name) { case 'username':