Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Unable to validate the fields into React-native

$
0
0

I'm working into functional components and managing the sate by hooks but facing problem into hooks while validation the form.

here is my states:

const [email, setEmail] = useState('');const [password, setPassword] = useState('');const [validEmail, setValidEmail] = useState(true);const [validPassword, setValidPassword] = useState(true);

and here is my validation method is working fine into debug app but facing problem when I released the app.

const validateFields = (): void => {const emailText = emailconst validEmailText = validEmailconst passwordText = passwordconst validPasswordText = validPasswordif (!validEmailText || !emailText) {  setValidEmail(false);  return;} else if (!validPasswordText || !passwordText) {  setValidPassword(false);  return;}setIsLoading(true);doSingIn(email, password);

};


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>