I am using React-quill for making a discussion forum. I need to handle it using Redux-form but I am getting error while receiving value from it. Every time i enter some thing on the editor the form gives value something like:
<p><br></p> in the string format. So is there any way to fix this. I need to save the content to MongoDB and i am expecting some idea on how do this.
Guys the issue has been solved by using this bunch of code.
<ReactQuill
{...input}
onChange={(newValue, delta, source) => {
if (source === 'user') {
input.onChange(newValue);
}
}}
onBlur={(range, source, quill) => {
input.onBlur(quill.getHTML());
}}/>
Most helpful comment
Guys the issue has been solved by using this bunch of code.
<ReactQuill {...input} onChange={(newValue, delta, source) => { if (source === 'user') { input.onChange(newValue); } }} onBlur={(range, source, quill) => { input.onBlur(quill.getHTML()); }}/>