@remirror/react
TypeScript icon, indicating that this package has built-in type declarations

2.0.35 • Public • Published

@remirror/react

Hooks and components for consuming remirror with your fave framework React.

npm bundle size (scoped) npm

Installation

yarn add @remirror/react # yarn
pnpm add @remirror/react # pnpm
npm install @remirror/react # npm

Usage

For in depth usage with proper code example see the docs.

Controlled Editor

import React, { useCallback } from 'react';
import { fromHtml, RemirrorEventListener } from 'remirror';
import { BoldExtension, ItalicExtension, UnderlineExtension } from 'remirror/extensions';
import { createReactManager, ReactExtensions, Remirror, useRemirror } from '@remirror/react';

type Extension = ReactExtensions<ListPreset | BoldExtension>;
const extensions = () => [new BoldExtension(), new ItalicExtension(), new UnderlineExtension()];

const MyEditor = () => {
  const { manager, state, onChange } = useRemirror<Extension>({
    extensions,
    content: '<p>This is the initial value</p>',
    stringHandler: 'html',
  });

  const [value, setValue] = useState(initialValue);

  return <Remirror manager={manager} state={state} onChange={onChange} />;
};

Readme

Keywords

none

Package Sidebar

Install

npm i @remirror/react

Weekly Downloads

21,330

Version

2.0.35

License

MIT

Unpacked Size

360 kB

Total Files

9

Last publish

Collaborators

  • ocavue
  • ifiokjr