Created
March 3, 2017 20:10
-
-
Save chrisdel101/d023a7c99dfdd8bddf8fcb96546bcb51 to your computer and use it in GitHub Desktop.
Idea not priting every item
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
<div className="history">{this.state.history.map((item,index) => {index | |
IF (CURRENT ITEM IS === LAST ITEM) THEN DON'T PRINT CURRENT ITEM | |
return ( | |
<div key={index} onClick={this.goBackHistory.bind(this,index)}> | |
{item.title} | |
</div> | |
) | |
}) | |
} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment