From 23ef84d1f8bd6f13fc4dee0fb64e2c11f3311c8e Mon Sep 17 00:00:00 2001 From: Maksim Chervonnyi Date: Fri, 20 Sep 2024 16:47:56 +0200 Subject: [PATCH] fix rerender auth signup form --- catalog/app/containers/Auth/SignUp.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/catalog/app/containers/Auth/SignUp.js b/catalog/app/containers/Auth/SignUp.js index 07089a52881..641da11a557 100644 --- a/catalog/app/containers/Auth/SignUp.js +++ b/catalog/app/containers/Auth/SignUp.js @@ -45,9 +45,9 @@ function PasswordSignUp({ mutex, next, onSuccess }) { const [email, setEmail] = React.useState('') const [username, setName] = React.useState('') const onFormChange = React.useCallback( - async ({ values }) => { - if (email !== values.email) setEmail(values.email) - if (username !== values.username) setName(values.username) + async ({ modified, values }) => { + if (modified.email && email !== values.email) setEmail(values.email) + if (modified.username && username !== values.username) setName(values.username) }, [email, username], ) @@ -135,7 +135,10 @@ function PasswordSignUp({ mutex, next, onSuccess }) { submitting, }) => (
- +