Last active
December 7, 2015 06:29
-
-
Save chihirokaasan/2f5847524993b65dc735 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> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script src="./build/hello.js"></script> | |
</body> | |
</html> |
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
<!--ビルドされたファイル。こちらは必要ありません。htmlはこちらのビルド後のjsファイルを読み込みます--> | |
var HelloWorld = React.createClass({displayName: "HelloWorld", | |
render: function() { | |
return ( | |
React.createElement("p", null, "Hello!World!") | |
); | |
} | |
}); | |
// id='app'に<HelloWorld />を埋め込む(マウント) | |
var m = React.render(React.createElement(HelloWorld, null), document.getElementById('app')); | |
document.getElementById('app') |
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
var HelloWorld = React.createClass({ | |
render: function() { | |
return ( | |
<p>Hello!World!</p> | |
); | |
} | |
}); | |
// id='app'に<HelloWorld />を埋め込む(マウント) | |
var m = React.render(<HelloWorld />, document.getElementById('app')); | |
document.getElementById('app') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment