Created
November 25, 2015 03:10
-
-
Save friej715/7e39feea0aca7784b03a to your computer and use it in GitHub Desktop.
a part of a tweet deleter
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 Page = React.createClass({ | |
getInitialState: function() { | |
return { | |
tweets: {}, | |
} | |
}, | |
componentDidMount: function() { | |
$.get("http://localhost:3000/tweets", function(data) { | |
var d = data[0]; | |
console.log(d) | |
if (this.isMounted()) { | |
this.setState({tweets: d}) | |
} | |
}.bind(this)) | |
}, | |
render: function() { | |
console.log(this.state.tweets) | |
return ( | |
<div></div> | |
) | |
} | |
}) | |
ReactDOM.render( | |
<Page/>, document.getElementById("main") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment