reactjsrte

react-rte toolbarConfig={[]} and showToolbar={false}


I'm trying to remove the toolbar from react-rte, so I tried

        toolbarConfig={[]},
        showToolbar={false}

I just want to show some html, that's all.

But it gives me this :

enter image description here

How can I remove toolbar in react-rte?

codesandbox.io


Solution

  • It seems like there is no such option as showToolbar. You can set the readOnly option to true, this will prevent the rendering of the toolbar (See RichtTextEditor.js:122.). Check this Codesandbox, please note that I used createValueFromString(...) (Source) for state initialization (requires the markup as string and a format option (string) ). You can adapt the format of the markup, I've used html for the sandbox (See available all available options here). Furthermore, feel free to delete toolbarConfig parameter, it isn't required for your use-case.