I want to create RichTextBox(wysiwyg) on Next.Js using SunEditor, but I am getting TypeError: core._resourcesStateChange is not a function
. I do not encounter any problems when I try the same code on React.js. How can I fix this situation?
Editor Component
import React from "react";
import 'suneditor/dist/css/suneditor.min.css';
import dynamic from "next/dynamic";
const SunEditor = dynamic(() => import("suneditor-react"), {
ssr: false,
});
const TextEditor2 = props => {
return (
<div>
<SunEditor />
</div>
);
};
export default TextEditor2;
index.js
import "suneditor/dist/css/suneditor.min.css";
import styles from "../styles/Home.module.css";
import TextEditor2 from "../components/TextEditor2";
export default function Home() {
return (
<div className={styles.container}>
<TextEditor2/>
</div>
);
}
had the same issue solved by installing this version of suneditor
[email protected]
and works with nextjs 13.1.1