Skip to content

Adding || to alt tag causes a false positive  #2

Closed
@jamsea

Description

@jamsea

Currently getting a false positive with this block of code:

<img
    alt={briefHeadline || "Player thumbnail"}
    src={`${posterImage}`}
    style={styles.img}
/>

Even though this passes:

<img
    alt={briefHeadline}
    src={`${posterImage}`}
    style={styles.img}
/>

This unfortunately means there's a chance briefHeadline could be null/undefined preventing an alt tag from being rendered. Any ideas of what could be wrong?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions