Skip to content

Instantly share code, notes, and snippets.

@thiskevinwang
Last active February 6, 2019 21:36
Show Gist options
  • Save thiskevinwang/82570ecc082ec6e3ad9e1d9141a9548a to your computer and use it in GitHub Desktop.
Save thiskevinwang/82570ecc082ec6e3ad9e1d9141a9548a to your computer and use it in GitHub Desktop.
// 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