Skip to content

Conversation

@ryuever
Copy link

@ryuever ryuever commented Jan 16, 2020

      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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant