Last active
May 6, 2016 12:03
-
-
Save pugiemonn/1075f7299f7fa913ad1cec2ab31b0e2f to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://fb.me/react-0.13.3.js"></script> | |
<script src="http://fb.me/JSXTransformer-0.13.3.js"></script> | |
</head> | |
<body> | |
<div id="app"></div><!-- ←ここに埋め込まれる --> | |
<!-- 以下、Reactのプログラム --> | |
<!-- (jsxを使っているのでtext/jsxと書く) --> | |
<script type="text/jsx"> | |
var HelloWorld = React.createClass({ | |
// <HelloWorld />をレンダリング(表示) | |
render: function() { | |
return ( | |
<p>Hello!World!</p> | |
); | |
} | |
}); | |
// id='app'に<HelloWorld />を埋め込む(マウント) | |
var m = React.render(<HelloWorld />, document.getElementById('app')); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment