Skip to content

Instantly share code, notes, and snippets.

@chrisdel101
Last active January 22, 2019 21:07
Show Gist options
  • Save chrisdel101/07731f53ece364a7e3825588c9f5e900 to your computer and use it in GitHub Desktop.
Save chrisdel101/07731f53ece364a7e3825588c9f5e900 to your computer and use it in GitHub Desktop.
.includes with class
if(this.props.indexes){
//so props does exist
if(i === 100){
console.log(this.props.indexes.includes(i))
//this is true
}
return(
//yet this still does not add the class on 100
<div className={`box ${(this.props.indexes.includes(i) ? 'backgroundColor' : '')}`}>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment