-
-
Save chrisdel101/07731f53ece364a7e3825588c9f5e900 to your computer and use it in GitHub Desktop.
.includes with class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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