79466825

Date: 2025-02-25 14:10:50
Score: 3
Natty:
Report link

Use !!loading not {loading}

disabled={email.length==0||password.length<7 || !!loading}

TouchableOpacity's props.disabled MUST be a strict boolean, but you have:

disabled={email.length==0||password.length<7 ||{loading}}

{loading} is already inside brackets, disabled={...}. The outer brackets are all you need.

So that reads as an object literal instead just the loading variable (ie {loading} = {loading:loading} ). Just remove the inner brackets to have loading read as a variable. If your loading variable is ever optional( boolean|undefined) or an empty string, cast it to boolean just in case: (!!loading).

If you get similar errors, check your other props.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): get similar error
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Tyler