Target: Users should be capable of checking the checkbox by touching the text next to it
Well, without react hook form It was easy to simulate a “label” tag like in HTML, using inPress and the state with de checkbox´s value
But now I have to wrap the label and the checkbox into the “Controller” component from react-hook-form and it´s how it has to look to work
<Controller
control={control}
defaultValue={false}
render={({ field: { onChange, value } }) => (
<TouchableOpacity style={styles.checkboxWrapper}>
<CheckBox
value={value}
onValueChange={(value) => onChange(value)}
color={colors.primary}
/>
<Text style={styles.checkboxLabel}>
Actualmente trabajo en este rol
</Text>
</TouchableOpacity>
)}
name="current"
/>
I can´t pass my state to value and onValueChange. I sow a chance of make it work but I would need to pass a “ref” to the checkbox and there is no a prop for that right now
I dont see other way of making it work
something else, it´s the correct category for this question?