Created
May 4, 2015 11:57
-
-
Save jessy1092/8e6ee7e888e62f7dfd61 to your computer and use it in GitHub Desktop.
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Hello React</title> | |
| <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.12.1/semantic.min.css"> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/react/0.13.2/react-with-addons.min.js"></script> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/react/0.13.2/JSXTransformer.js"></script> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.12.1/semantic.min.js"></script> | |
| </head> | |
| <body> | |
| <div id="example"></div> | |
| <div id="modal_test" class="ui dimmer modals page"></div> | |
| <script type="text/jsx"> | |
| var TestButton = React.createClass({ | |
| render: function () { | |
| return ( | |
| <div className="ui button" onClick={this._onClick}>Modal Test</div> | |
| ); | |
| }, | |
| _onClick: function () { | |
| console.log("hello"); | |
| $('.modal').modal('show'); | |
| } | |
| }); | |
| var TestModal = React.createClass({ | |
| render: function () { | |
| return ( | |
| <div className="ui modal"> | |
| <div className="content"> | |
| <div className="description"> Test </div> | |
| </div> | |
| </div> | |
| ); | |
| } | |
| }); | |
| React.render( | |
| <TestModal />, | |
| document.getElementById('modal_test') | |
| ); | |
| React.render( | |
| <TestButton />, | |
| document.getElementById('example') | |
| ); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did this work? calling
$('.modal').modal('show');modifies the DOM, and react seems to go apeshit with errors like: