draft-js-multidecorators icon indicating copy to clipboard operation
draft-js-multidecorators copied to clipboard

add missing param `contentState`

Open ryuever opened this issue 5 years ago • 0 comments

      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 === 'LINK_SPAN'
        }, cb);
      }

for strategy mode, contentState could be a conditional expression. if contentState is missing on upstream, it could be always null

ryuever avatar Jan 16 '20 15:01 ryuever