Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to integrate CheckBox component into hookform controller? #26

Open
angelopedroso opened this issue Apr 30, 2024 · 1 comment
Open

Comments

@angelopedroso
Copy link

No description provided.

@angelopedroso angelopedroso changed the title How to integrate CheckBox component into hookform's controller? How to integrate CheckBox component into hookform controller? Apr 30, 2024
@ghbishal
Copy link

ghbishal commented May 5, 2024

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants