Home > Net >  Why it takes two presses to do what i want? React Native
Why it takes two presses to do what i want? React Native

Time:11-09

I have an input which passes its value to a useState on its parent. That value gets passed to other component (Custom button). There the input data gets validated and returns to the parent in another useState if there's an error and where ("e" = error in email, "p" = error in password, "ep" = error in email and password) Then the border color of the input is set accordingly to that response, if there is an error it turns red, otherwise it turns white.

But it only works the second time i press the button (With which everything is supposed to start)

HELP!

  • Related