Make new dictionary to make React render on setState

This commit is contained in:
Justin Edmund 2022-02-01 00:42:49 -08:00
parent 305f0e1f88
commit f1b50fe051

View file

@ -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':