Skip to content
Discussion options

You must be logged in to vote

you can use render prop, https://react-hook-form.com/api/#Controller

eg:

<Controller
  control={control}
  name="test"
  render={(
    { onChange, onBlur, value, name, ref },
    { invalid, isTouched, isDirty }
  ) => (
    <Checkbox
      onBlur={onBlur}
      onChange={(e) => onChange(e.target.checked)}
      checked={value}
      inputRef={ref}
    />
  )}
/>

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@king612
Comment options

@bluebill1049
Comment options

@king612
Comment options

Answer selected by bluebill1049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants