I tried to use next/dynamic from the README file, but nextjs 13 still complains about document is undefined error. Then I tried use client, it works. However, is it the right way to do this? If so, should the README file be updated?
My fix is:
// page.tsx
import SunEditor from "../components/Editor"
// Editor.tsx
'use client'
import SunEditor from 'suneditor-react'
import 'suneditor/dist/css/suneditor.min.css'
export default function Editor() {
return <SunEditor />
}
I tried to use
next/dynamic
from the README file, but nextjs 13 still complains aboutdocument
is undefined error. Then I trieduse client
, it works. However, is it the right way to do this? If so, should the README file be updated?My fix is: