Search code examples
reactjstinymce

React Tiny.MCE - How to create custom plugin on React


Let's consider react application with Tiny.MCE component. I need to create a custom plugin. But I would like to create this component as a React component. I have no idea how could I inject the react component to my plugin. Any idea?


Solution

  • TinyMCE plugins have a specific format for how the JavaScript has to be created/bundled. A React component won't fulfill that requirement.

    The process for creating a TinyMCE plugin is documented here:

    https://www.tiny.cloud/docs/advanced/creating-a-plugin/

    I would recommend placing your custom plugins in their own directory and using the external_plugins option to load them. This will keep your custom code separate from the editor and avoid things being deleted/overwritten if you update TinyMCE itself.