From 0861cc745506d9a4c901b0e50d522ff4055d9557 Mon Sep 17 00:00:00 2001 From: "Rayyan (Rayy)" Date: Tue, 12 Sep 2023 10:40:54 +0000 Subject: [PATCH] Adding States to Form Groups. --- src/pages/Signup.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/pages/Signup.js b/src/pages/Signup.js index b23b0b1..545bc2d 100644 --- a/src/pages/Signup.js +++ b/src/pages/Signup.js @@ -16,10 +16,13 @@ export function Signup ( props ) { } useEffect( () => { - if(username.length > 4) { - console.log("longer than 4 characters") + if(username.length >= 4) { + setValidusername(true) } - }, [username] ) + else { + setValidusername(false) + } + }, [username] ) return ( @@ -38,11 +41,21 @@ export function Signup ( props ) { Email - + setUseremail(evt.target.value) } + /> Password - + setUserpassword(evt.target.value) } + />