Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Created March 8, 2016 07:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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