react-quill icon indicating copy to clipboard operation
react-quill copied to clipboard

How to display the content in the editor outside the editor

Open hussamkhatib opened this issue 4 years ago • 2 comments

Suppose I have the markup stored. I want to display the text in another div . I tried using dangerouslySetInnerHTML , which shows error in the web page . Is this something like rendering the editor Itself by hidding the editor markdown buttons and other styles which will make the editor look like a normal div.

hussamkhatib avatar Sep 16 '21 18:09 hussamkhatib

@hussamkhatib what did you end up doing here? Running into the same roadblock.

adenta avatar Mar 24 '22 18:03 adenta

I rendered the editor itself without readOnly prop.

import 'react-quill/dist/quill.snow.css'

import dynamic from 'next/dynamic'
import React, { FC, ReactElement } from 'react'

interface Props {
  defaultValue: any
}
const ReactQuill = dynamic(() => import('react-quill'), { ssr: false })

const TextEditorReadOnly: FC<Props> = ({ defaultValue }): ReactElement => (
  <ReactQuill defaultValue={defaultValue} readOnly theme="bubble" />
)
export default TextEditorReadOnly

hussamkhatib avatar Mar 25 '22 06:03 hussamkhatib