How do I convert a plain HTML-code into a value of react-quill text editor?

1.6k Views Asked by At

I'm using react-quill as a rich-text editor. I need to insert an already existing HTML code so it will be displayed as a text inside of the editor. Is there any ability to do something like this?

let htmlSample = "<p>It's a test html <b>to be inserted!</b></p>
<ReactQuill htmlValue="{htmlSample}" />

And the results would look like: enter image description here

1

There are 1 best solutions below

0
On

Okay, I got this. If anyone else wonders how to insert plain html - simply put your custom editor area like this:

<ReactQuill value={this.state.value}>
<div class="your-custom-container">
<p>your custom html</p>
</div>
</ReactQuill>