encountered the error ReferenceError: document is not defined when attempting to refresh the page
I am working on creating a component using react-quill and then calling that component within a page.
This is my component :
import React, { useState } from 'react'
import ReactQuill from 'react-quill'
import 'react-quill/dist/quill.snow.css'
const RichTextEditor = () => {
if (typeof window !== "undefined") {
console.log("OK")
}
const [body, setBody] = useState('')
const handleBodyChange = (value: any) => {
setBody(value)
}
return (
<ReactQuill value={body} onChange={handleBodyChange} />
)
}
export default RichTextEditor;