Skip to content

Instantly share code, notes, and snippets.

@alexleventer
Created October 7, 2015 00:54
Show Gist options
  • Save alexleventer/dd63ed89fb4a4886b703 to your computer and use it in GitHub Desktop.
Save alexleventer/dd63ed89fb4a4886b703 to your computer and use it in GitHub Desktop.
var React = require('react');
var MainLayout = require('./layouts/main');
var $ = require('jquery');
var dashboard = React.createClass({
componentWillMount: function(){
$.ajax({
url: 'localhost:3000/ga',
type: 'GET',
dataType: 'json',
contentType: "application/json",
success: function(res) {
console.log(res);
}, failure: function(err) {
console.log(err);
}
});
},
getInitialState: function(){
return {
data: null
}
},
render: function() {
//if(this.state.data){
//return (
//new layout with data
//);
//}
return (
<MainLayout title={this.props.title} user={this.props.user} data={this.props.data}>
</MainLayout>
);
}
});
module.exports = dashboard;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment