Skip to content

Instantly share code, notes, and snippets.

@pirate
Last active February 2, 2017 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pirate/656f03a582619a3f4dd43c9cb3da0bf4 to your computer and use it in GitHub Desktop.
Save pirate/656f03a582619a3f4dd43c9cb3da0bf4 to your computer and use it in GitHub Desktop.
import React from 'react'
import ReactDOM from 'react-dom'
const Leaderboard = ({users}) =>
<div>
<h1>Featured Players</h1>
{users.map(user =>
<a href={`/user/${user.username}/`}>
{user.username}
</a>)}
</div>
ReactDOM.render(
React.createElement(Leaderboard, window.props), // gets the props that are passed in the template
window.react_mount, // a reference to the #react div that we render to
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment