React
RichTextEditor and useEditor() for React 18+, Remix, Gatsby and Vite.
On this page
Install
Usage
Good to know
- SSR-safe: the server renders an empty container and the hidden input, and the editor starts in the browser.
valueis loaded only when it differs from the HTML the editor last produced, so typing never moves the cursor.- Callbacks and the runtime options (
editable,placeholder,aria*,dir,contentLang) follow every render. Everything else is read at mount: give the component a newkeyto change it.
Always sanitize on the server
The editor sanitizes what it loads and produces, but that is not a security boundary: anyone can post any string to your API. Sanitize the HTML again with a library you trust before you store it or render it for other users.