Skip to content
Discussion options

You must be logged in to vote

Your TextInput does not receive onChange props. If you want to pass in a custom onChange, try this:

function TxtInput({ onChange: yourOnChange /* other props here */ }) {
  return (
    /* rest of the code */
    <Controller
      render={({ field: { onChange: rhfOnChange } }) => (
        <TextField
          required={required}
          fullWidth
          label={label}
          id={name}
          inputProps={{ 'aria-label': label }}
          onBlur={onBlur}
          onChange={(ev) => {
            const { target: { value }} = ev
            
            rhfOnChange(value)
            yourOnChange(value)
          }}
          checked={value}
          inputRef={ref}
          {...r…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@bluebill1049
Comment options

@aadlc
Comment options

@thanh-nguyen-95
Comment options

@aadlc
Comment options

Answer selected by bluebill1049
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants