Skip to content

Instantly share code, notes, and snippets.

@Gaya
Created November 9, 2017 16:00
Show Gist options
  • Save Gaya/25454c5eb41da054c4c26d39a141c6bb to your computer and use it in GitHub Desktop.
Save Gaya/25454c5eb41da054c4c26d39a141c6bb to your computer and use it in GitHub Desktop.
How to use React Quill inside Redux Forms
import React from 'react';
import { Field } from 'redux-form';
import ReactQuill from 'react-quill';
function renderQuill({ input }) {
return (
<ReactQuill
{...input}
onChange={(newValue, delta, source) => {
if (source === 'user') {
input.onChange(newValue);
}
}}
onBlur={(range, source, quill) => {
input.onBlur(quill.getHTML());
}}
/>
);
}
// Usage:
<Field name="description" component={renderQuill} />;
@tufail
Copy link

tufail commented Mar 8, 2020

Hi , Could you please add redux-form inline validation to it.,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment