draftjs-multidecorators

Combine multiple decorators for DraftJS

Usage no npm install needed!

<script type="module">
  import draftjsMultidecorators from 'https://cdn.skypack.dev/draftjs-multidecorators';
</script>

README

draftjs-multidecorator

Build Status NPM version

Combine multiple Draft's decorators into one.

Installation

$ npm install draftjs-multidecorator

Usage

var Draft = require('draft-js');
var MultiDecorator = require('draftjs-multidecorator');

var decorator = new MultiDecorator([
    new SomeCustomDecorator(),

    // This decorator will have more priority:
    new Draft.CompositeDecorator([ ... ])
]);

var editorState = Draft.EditorState.createEmpty(decorator)