Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a ternary rather than multiple && #19

Open
oliverjam opened this issue Sep 28, 2018 · 0 comments
Open

Use a ternary rather than multiple && #19

oliverjam opened this issue Sep 28, 2018 · 0 comments
Labels
good first issue Good for newcomers

Comments

@oliverjam
Copy link

Here you're rendering one thing if showZombie is true and another thing if it's false. A ternary would probably make more sense than two separate &&s

{this.state.showZombie ? (
  <img
    draggable="false"
    src={icon}
    alt={"zombie face"}
    id={this.props.id}
    onClick={this.toggle}
   />
) : (
  <div className="empty_img" id={this.props.id} />
)}
@Brymon Brymon added the good first issue Good for newcomers label Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants