Last active
August 29, 2015 14:08
-
-
Save svetlyak40wt/728ccb1f04d08f96d827 to your computer and use it in GitHub Desktop.
Testing jisp as react's JSX replacement
This file contains hidden or 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
| (mac mknode name | |
| `(mac ,name ,attrs ,children | |
| `(fn ((get React.DOM name) ,attrs ,children)))) | |
| (mknode div) | |
| (mknode ul) | |
| (mknode p) | |
| ; ... | |
| (= CommentBox (React.createClass | |
| (displayName: "CommentBox" | |
| render: (div (className: "commentBox") | |
| "Hello, world! I am a CommentBox.")))) | |
| (React.renderComponent | |
| (CommentBox null) | |
| (document.getElementById "react-content")) |
This file contains hidden or 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
| (= CommentBox (React.createClass | |
| (displayName: "CommentBox" | |
| render: (fn (React.DOM.div (className: "commentBox") | |
| "Hello, world! I am a CommentBox."))))) | |
| (React.renderComponent | |
| (CommentBox null) | |
| (document.getElementById "react-content")) |
This file contains hidden or 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 CommentBox = React.createClass({displayName: 'CommentBox', | |
| render: function() { | |
| return ( | |
| React.DOM.div({className: "commentBox"}, | |
| "Hello, world! I am a CommentBox." | |
| ) | |
| ); | |
| } | |
| }); | |
| React.renderComponent( | |
| CommentBox(null), | |
| document.getElementById('content') | |
| ); |
This file contains hidden or 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
| (def mknode name | |
| (fn attrs children | |
| ))) | |
| (= div (mknode "div")) | |
| (= CommentBox (React.createClass | |
| (displayName: "CommentBox" | |
| render: (div (className: "commentBox") | |
| "Hello, world! I am a CommentBox.")))) | |
| (React.renderComponent | |
| (CommentBox null) | |
| (document.getElementById "react-content")) |
This file contains hidden or 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 CommentBox = React.createClass({ | |
| render: function() { | |
| return ( | |
| <div className="commentBox"> | |
| Hello, world! I am a CommentBox. | |
| </div> | |
| ); | |
| } | |
| }); | |
| React.renderComponent( | |
| <CommentBox />, | |
| document.getElementById('content') | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment