Skip to main content

Editor42 in a React app

When to use

When the editor has to live in a React app and its content belongs to your component state — a form field, a CMS page editor, a comment box.

How it works

The <Editor> component from @editor42/editor42-react, controlled: value in, onEditorChange out, so the HTML under the box is the state React holds. Everything inside init is a plain Editor42 option, and the editor script itself is fetched from the CDN unless you point editor42ScriptSrc at your own copy.

How to start using

Install the component with npm install @editor42/editor42-react and drop <Editor> into your JSX. With no extra props it loads the editor from cdn.editor42.com — no account, no key.

See the React install page for controlled usage, self-hosting and the move from @tinymce/tinymce-react.