JSPM

@remirror/preset-react

1.0.0-next.29
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 85462
  • Score
    100M100P100Q159924F
  • License MIT

The core preset providing the functionality you need and want.

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.

Version Weekly Downloads Bundled size Typed Codebase MIT License


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@next

Usage

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 { ReactPreset } from '@remirror/preset-react';
import { CorePreset } from '@remirror/preset-core';

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.appendChild(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.

Credits

This package was bootstrapped with monots.