Created
November 9, 2017 16:00
-
-
Save Gaya/25454c5eb41da054c4c26d39a141c6bb to your computer and use it in GitHub Desktop.
How to use React Quill inside Redux Forms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} />; |
I am very thankful to you Man, Keep it Up
That was awesome. Very thankful! keep up!
Cool! Thanks!
🚀
Thank you!
🎆 🍾
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
Thanks a lot!