draft-js-multidecorators
draft-js-multidecorators copied to clipboard
Combine multiple decorators for DraftJS
``` const strategy = (contentBlock, cb, contentState) => { if (!contentState) return; contentBlock.findEntityRanges(character => { const entityKey = character.getEntity(); if (!entityKey) return false const entityType = contentState.getEntity(entityKey).getType() return entityType ===...
Adds support for DraftJS v0.10.0, which expects contentState to be passed in to each decorator. See https://facebook.github.io/draft-js/docs/v0-10-api-migration.html and https://github.com/facebook/draft-js/blob/master/src/model/decorators/DraftDecoratorType.js.