Skip to content

add missing param contentState#3

Open
ryuever wants to merge 1 commit into
SamyPesse:masterfrom
ryuever:fix-content-state
Open

add missing param contentState#3
ryuever wants to merge 1 commit into
SamyPesse:masterfrom
ryuever:fix-content-state

Conversation

@ryuever

@ryuever ryuever commented Jan 16, 2020

Copy link
Copy Markdown
      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