Skip to content

Tettra/draft-js-multidecorators

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

draft-js-multidecorators

Combine multiple Draft's decorators into one.

Installation

$ yarn add Tettra/draft-js-multidecorators

Usage

import {EditorState, CompositeDecorator} from 'draft-js';
import MultiDecorator from 'draft-js-multidecorators';

var decorator = new MultiDecorator([
    new CompositeDecorator([
    {
        strategy: handleStrategy,
        component: HandleSpan,
    },

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

var editorState = EditorState.createEmpty(decorator)

About

Combine multiple decorators for DraftJS

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%