Skip to content

Latest commit

 

History

History
594 lines (539 loc) · 17.6 KB

File metadata and controls

594 lines (539 loc) · 17.6 KB

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

For examples of the {productname} integration, visit the tinymce-react storybook.

Prerequisites

This procedure requires Node.js (and npm).

Procedure

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

    # npm 7+, extra double-dash is needed
    npm create vite@5 tinymce-react-demo -- --template react-swc
  2. Change to the newly created directory.

    cd tinymce-react-demo
  3. 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.

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

Next Steps