Last active
February 2, 2017 23:34
-
-
Save pirate/656f03a582619a3f4dd43c9cb3da0bf4 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
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