Integration with React hook form
dashty94 opened this issue · 1 comments
dashty94 commented
Checklist
- This is not covered in the repository examples.
- I am using the package latest version.
- This is a bug report or an enhancement proposal.
Description
How do you integrate it with React hook Form? I can't get the value of the editor and pass it to the form
chemiadel commented
Wrap it on Controller, Only way to get data is onSave so you need to save it by refs and use onChange of controller under save event:
<Controller
control={control}
name="editor"
render={(
{ onChange }
) => (
<MUIRichTextEditor
ref={ref}
onChange={()=>ref.current.save()}
onSave={data=>onChange(data)}
/>
)}
/>