megahertz/react-simple-wysiwyg

Custom toolbar not working

Closed this issue · 2 comments

I wanted to customize the toolbar according to the readme, but the default toolbar is displayed.

import { 
  BtnBold, 
  BtnItalic, 
  createButton, 
  Editor, 
  EditorProvider, 
  Toolbar
} from 'react-simple-wysiwyg';

const BtnAlignCenter = createButton('Align center', '≡', 'justifyCenter');

export default function CustomEditor({ value, onChange }) {
  return (
    <EditorProvider>
      <Editor value={value} onChange={onChange}>
        <Toolbar>
          <BtnBold />
          <BtnItalic />
          <BtnAlignCenter />
        </Toolbar>
      </Editor>
    </EditorProvider>
  );
}

image (6)

Chrome: 118.0.5993.88
react-simple-wysiwyg version: 3.0.2

But the Toolbar is display, when I moved the toolbar code after the

image (7)

Ah, that was my fault, sorry.