Skip to content

Instantly share code, notes, and snippets.

@sky4git
Last active February 28, 2016 00:43
Show Gist options
  • Save sky4git/31129616a27972500759 to your computer and use it in GitHub Desktop.
Save sky4git/31129616a27972500759 to your computer and use it in GitHub Desktop.
JSX syntax
// COMPILED JSX SYNTAX INTO JAVASCRIPT
// main container component
var Container = React.createClass({displayName: "Container",
render: function() {
return(
React.createElement("div", null,
React.createElement(PostsGroupJSON, {source: "ajax/ajaxjson.html"}),
React.createElement(PostsGroupHTML, {source: "ajax/ajaxdemo.html"})
)
);
}
});
// main container component
var Container = React.createClass({
render: function() {
return(
<div>
<PostsGroupJSON source='ajax/ajaxjson.html' />
<PostsGroupHTML source='ajax/ajaxdemo.html' />
</div>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment