Created
April 22, 2015 06:46
-
-
Save naoya/6c447fad0c7a95f55824 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
var React = require('react'); | |
var App = React.createClass({ | |
getInitialState: function() { | |
return { members: [] }; | |
}, | |
onClick: function() { | |
this.setState({ | |
members: ['黄前久美子', '加藤葉月', '川島緑輝', '高坂麗奈'] | |
}); | |
}, | |
render: function() { | |
var members = this.state.members.map(function(member) { | |
return <li>{member}</li>; | |
}); | |
return ( | |
<div> | |
<button onClick={this.onClick}>響け!ユーフォニアム</button> | |
<ul> | |
{members} | |
</ul> | |
</div> | |
); | |
} | |
}); | |
React.render(<App />, document.getElementById('app-container')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment