Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var App = React.createClass({
getInitialState: function(){
return {
todos: ["eat","code","sleep"]
}
},
render: function(){
var todos = this.state.todos.map(function(todo,index){
return <li key={index}>{todo}</li>
});
return (
<div>
<h1> Welcome to the ToDo list!</h1>
<ul>
{todos}
</ul>
</div>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment