Last active
February 6, 2019 21:36
-
-
Save thiskevinwang/82570ecc082ec6e3ad9e1d9141a9548a to your computer and use it in GitHub Desktop.
This file contains 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
// Inside Game's render method | |
const moves = history.map((step, move) => { | |
const desc = move | |
? "Go to move #" + move + " @ " + history[move].location | |
: 'Go to game start'; | |
return ( | |
<li key={move}> | |
<button onClick={() => this.jumpTo(move)}>{desc}</button> | |
</li> | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment