JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15956
  • Score
    100M100P100Q131043F
  • License MIT

The unofficial editor-js component for React

Package Exports

  • react-editor-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 (react-editor-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-editor-js

npm version

The unofficial editor-js component for React

DEMO: CodeSandbox

Getting Started

Install via npm (or yarn)

# editorjs and official plugins
npm install --save-dev react-editor-js @editorjs/checklist @editorjs/code @editorjs/delimiter @editorjs/editorjs @editorjs/embed @editorjs/header @editorjs/image @editorjs/inline-code @editorjs/link @editorjs/list @editorjs/marker @editorjs/paragraph @editorjs/quote @editorjs/raw @editorjs/simple-image @editorjs/table @editorjs/warning

Usage

import EditorJs from 'react-editor-js';

<EditorJs data={data} />;

API

Allow all options of editor-js

Name Type Description
enableReInitialize Boolean editor-js rerendering when componentDidUpdate

How do I use custom element?

It's simpleeeee

render() {
  return (
    <EditorJs holder="custom">
      <div id="custom" />
    </EditorJs>
  );
}

How to access editor-js instance?

You can access using instanceRef

async handleSave() {
  const savedData = await this.editorInstance.save();
}

componentDidMount() {
  this.editorInstance // access editor-js
}

render() {
  return <EditorJs instanceRef={instance => this.editorInstance = instance} data={data} />
}