-2
I have some input fields, both are set to states. I would like to make sure that you only allow clicking on the button if these fields are filled in. Obs:. I am Using Hooks
const [ name, setName ] = useState('');
const [ user, setUser ] = useState('');
const [ datanascimento, setDataNascimento ] = useState('');
const [ tel, setTel ] = useState('');
const [ email, setEmail] = useState('');
<TouchableOpacity
onPress={() => navigation.navigate('DeliverymanPhotos')}
style={styles.btnPrimary}>
<Text style={styles.btnPrimaryText}>
Confirmar
</Text>
</TouchableOpacity>
Not only do you create a function that checks this and puts it on
onClick
ofTouchableOpacity
?– Rafael Tavares