Hosting the TinyMCE .zip package with the React framework

The Official TinyMCE React component integrates TinyMCE into React projects. This procedure creates a basic React application containing a TinyMCE editor.

For examples of the TinyMCE integration, visit the tinymce-react storybook.


This procedure requires Node.js (and npm).


  1. Use the Vite package and the React SWC plugin to create a new React project named tinymce-react-demo.

    npm create vite@5 tinymce-react-demo -- --template react-swc
  2. Change to the newly created directory.

    cd tinymce-react-demo
  3. Install the @tinymce/tinymce-react package and save it to your package.json with --save.

    npm install --save @tinymce/tinymce-react
  4. Unzip the content of the tinymce/js folder from the TinyMCE zip into the public folder. Afterwards the directory listing should be similar to below:

    > tree -L 2 public
    ├── favicon.ico
    ├── index.html
    ├── logo192.png
    ├── logo512.png
    ├── manifest.json
    ├── robots.txt
    └── tinymce
        ├── icons
        ├── langs
        ├── license.txt
        ├── models
        ├── plugins
        ├── skins
        ├── themes
        ├── tinymce.d.ts
        └── tinymce.min.js
  5. Using a text editor, open ./eslintrc.cjs and add 'src/tinymce' to the ignorePatterns array.

    Diff of .eslintrc.js
    diff --git a/.eslintrc.cjs b/.eslintrc.cjs
    index 3b3b3b3..4b4b4b4 100644
    --- a/.eslintrc.cjs
    +++ b/.eslintrc.cjs
    @@ -7,7 +7,7 @@ modules.exports = {
    -  ignorePatterns: ['dist', '.eslintrc.cjs'],
    +  ignorePatterns: ['dist', '.eslintrc.cjs', 'src/tinymce'],
       parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
       settings: { react: { version: '18.2' } },
       plugins: ['react-refresh'],
  6. Using a text editor, open ./src/App.jsx and replace the contents with:

    import { useRef } from 'react';
    import { Editor } from '@tinymce/tinymce-react';
    import './App.css';
    export default function App() {
      const editorRef = useRef(null);
      const log = () => {
        if (editorRef.current) {
      return (
            onInit={(_evt, editor) => editorRef.current = editor}
            initialValue='<p>This is the initial content of the editor.</p>'
              height: 500,
              menubar: false,
              plugins: [
                'advlist', 'autolink', 'lists', 'link', 'image', 'charmap',
                'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
                'insertdatetime', 'media', 'table', 'preview', 'help', 'wordcount'
              toolbar: 'undo redo | blocks | ' +
                'bold italic forecolor | alignleft aligncenter ' +
                'alignright alignjustify | bullist numlist outdent indent | ' +
                'removeformat | help',
              content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
          <button onClick={log}>Log editor content</button>
  7. Update the licenseKey option in the editor element and include your License Key.

  8. Test the application using the Node.js development server.

    • To start the development server, navigate to the tinymce-react-demo directory and run:

      npm run dev
    • To stop the development server, select on the command line or command prompt and press Ctrl+C.

Deploying the application to a HTTP server

The application will require further configuration before it can be deployed to a production environment. For information on configuring the application for deployment, see: Building for Production or Deploying a Static Site.

To deploy the application to a local HTTP Server:

  1. Navigate to the tinymce-react-demo directory and run:

    npm run build
  2. You can optionally preview the production build by running:

    npm run preview
  3. Copy the contents of the tinymce-react-demo/dist directory to the root directory of the web server.

The application has now been deployed on the web server.

Additional configuration is required to deploy the application outside the web server root directory, such as http://localhost:<port>/my_react_application.

Next Steps