react-draft-wysiwyg settings options doesn't work

Viewed 16

I'm using react-draft-wysiwyg in a NextJS application, but the text settings (like bold, italics) dropdowns don't work. Is there any more configuration I need to do? I didn't find anything in the documentation. Here is the code I have so far.

[UPDATE] => I saw that removing strictmode, it starts to work normally. But I don't have the possibility to leave strict mode disabled.

import { useState } from "react";
import dynamic from "next/dynamic";
import { EditorState } from "draft-js";
import { EditorProps } from "react-draft-wysiwyg";
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
import styles from "./styles.module.css";

const Editor = dynamic<EditorProps>(
  () => import("react-draft-wysiwyg").then((mod) => mod.Editor),
  { ssr: false }
);
const TextEditor = () => {
  const [editorState, setEditorState] = useState(EditorState.createEmpty());

  const onEditorStateChange = (editorState: EditorState) =>
    setEditorState(editorState);

  return (
    <Editor
      editorState={editorState}
      editorClassName={styles.editor_container}
      toolbarClassName={styles.toolbar_container}
      onEditorStateChange={(state) => onEditorStateChange(state)}
    />
  );
};

export default TextEditor;
0 Answers
Related