Reputation: 369
How to integrate Quill (rich-text-editor) with react-final-form?
Upvotes: 0
Views: 548
Reputation: 1
Thats it works for me
import { FC } from 'react';
import { Field } from 'react-final-form';
import ReactQuill from 'react-quill';
const FormQuill: FC<{ name: string }> = ({ name }) => (
<Field name={name}>
{({ input: { value, ...input } }) => (
<ReactQuill
value={value}
onChange={(newValue, delta, source) => {
if (source === 'user') {
input.onChange(newValue);
}
}}
/>
)}
</Field>
);
export default FormQuill;
Upvotes: 0