Closed yalamber closed 3 weeks ago
What's the difference between FormInput and Input, It seems like FormInput is not exported.
You can try it like this
import { Controller, useFormContext } from 'react-hook-form'
const { control } = useFormContext()
return (
<Controller
name={`blocks.${blockIndex}.items.${itemIndex}.result.answer`}
control={control}
render={({ field: { value, onChange } }) => (
<Input defaultValue={value ?? ''} onChange={onChange} />
)}
/>
)
Thank you, issue was fixed in 2.1.8
version
When using Input component with react-hook-form we are receiving below error. Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?