@draft-js-enhance-plugins/soft-newline
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

DraftJS Soft Newline Plugin

This is a plugin for the @draft-js-plugins/editor.

Feature

Press tab+enter to insert soft newline. No new unstyled block will be created.

Refer to insertSoftNewline.

Usage

import { EditorState } from 'draft-js';
import Editor from '@draft-js-plugins/editor';
import createSoftNewlinePlugin from '@draft-js-enhance-plugins/soft-newline';

const softNewlinePlugin = createSoftNewlinePlugin();

const plugins = [softNewlinePlugin];

function Example() {
  const [editorState, setEditorState] = useState(EditorState.createEmpty());

  return (
    <Editor
      editorState={editorState}
      onChange={setEditorState}
      plugins={plugins}
    />
  );
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @draft-js-enhance-plugins/soft-newline

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

3.83 kB

Total Files

6

Last publish

Collaborators

  • varieget