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.
This procedure requires Node.js (and npm).
-
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 -
Change to the newly created directory.
cd tinymce-react-demo -
Test the application using the Node.js development server.
-
To start the development server, navigate to the
tinymce-react-demodirectory and run:npm run dev
-
To stop the development server, select on the command line or command prompt and press Ctrl+C.
-
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:
-
Navigate to the
tinymce-react-demodirectory and run:npm run build
-
You can optionally preview the production build by running:
npm run preview
-
Copy the contents of the
tinymce-react-demo/distdirectory 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. |
-
For examples of the {productname} integration, see: the tinymce-react storybook.
-
For information on customizing:
-
{productname} integration, see: react-ref.adoc.
-
{productname}, see: basic-setup.adoc.
-
The React application, see: Getting Started with Vite or the React documentation.
-