Package Exports
- @remirror/preset-react
- @remirror/preset-react/dist/preset-react.browser.cjs.js
- @remirror/preset-react/dist/preset-react.browser.esm.js
- @remirror/preset-react/dist/preset-react.cjs.js
- @remirror/preset-react/dist/preset-react.esm.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@remirror/preset-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@remirror/preset-react
The core preset providing the functionality you need and want.
Installation
# yarn
yarn add @remirror/preset-react@next @remirror/pm@next
# pnpm
pnpm add @remirror/preset-react@next @remirror/pm@next
# npm
npm install @remirror/preset-react@next @remirror/pm@nextUsage
This preset adds
- Server side support for nodes and marks.
- Transformations for server side components.
- Placeholder support for the editor.
import { RemirrorManager } from '@remirror/core';
import { CorePreset } from '@remirror/preset-core';
import { ReactPreset } from '@remirror/preset-react';
const reactPreset = new ReactPreset({ rootContent: 'block*' });
// Create the preset
const reactPreset = new ReactPreset(transformers);
// Create the Editor Manager with the required preset.
const manager = RemirrorManager.create([reactPreset]);
// Pass the dom element to the editor. If you are using `@remirror/react` this is done for you.
const element = document.createElement('div');
document.body.append(element);
// Add the view to the editor manager.
manager.addView(element);
// You now have a basic working editor.Granted, the above won't do much. It will allow you to type, and what else do you really need in an editor.