Created
March 8, 2016 07:34
-
-
Save codeaholicguy/1e6e79443103c2a0ae0e 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 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