How to integrate CheckBox component into hookform controller?
angelopedroso opened this issue · comments
this should work. currently what i have for the check box and other stuff are my custom components you can just use simple checkbox.
<View >
<Controller
name="terms"
control={control}
render={({ field: { value, onChange } }) => (
<View style={styles.termsConditionContainer}>
<CheckBox containerStyle={styles.checkBox} selected={value} onSelect={onChange} />
<StyledText typography="Label1">I agree to the Terms and Conditions</StyledText>
</View>
)}
/>
{errors.terms && <FormError name="terms" errors={errors} />}
</View>