I'm trying to use toast ui editor react, am I the only one like this?

277 views Asked by At

At first, I tried to download npm install @toast-ui/react-editor, but I couldn't download it, so I downloaded it to npm install @toast-ui/react-editor --force and wrote the code

import { Editor } from '@toast-ui/react-editor';
import '@toast-ui/editor/dist/toastui-editor.css';

export default function ToastEditor() {

  return (
    <div>
      <Editor
        previewStyle="vertical"
        height="300px"
        toolbarItems={[
          ['heading', 'bold', 'italic', 'strike'],
          ['hr', 'quote'],
          ['ul', 'ol', 'task', 'indent', 'outdent'],
          ['table', 'image', 'link'],
          ['code', 'codeblock']
        ]}
        useCommandShortcut={false}
      ></Editor>
    </div>
  );
}

But there are some weird things written in the editor, so I can do it

error page

I set the initialValue to ' ', but I can't see the placeholder

import { Editor } from '@toast-ui/react-editor';
import '@toast-ui/editor/dist/toastui-editor.css';

export default function ToastEditor() {

  return (
    <div>
      <Editor
        previewStyle="vertical"
        height="300px"
        toolbarItems={[
          ['heading', 'bold', 'italic', 'strike'],
          ['hr', 'quote'],
          ['ul', 'ol', 'task', 'indent', 'outdent'],
          ['table', 'image', 'link'],
          ['code', 'codeblock']
        ]}
        useCommandShortcut={false}
        initialValue=' '
        placeholder='sadf'
      ></Editor>
    </div>
  );
}

enter image description here

0

There are 0 answers