Skip to content

Instantly share code, notes, and snippets.

@chihirokaasan
Last active December 7, 2015 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chihirokaasan/2f5847524993b65dc735 to your computer and use it in GitHub Desktop.
Save chihirokaasan/2f5847524993b65dc735 to your computer and use it in GitHub Desktop.
<!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>
<!--ビルドされたファイル。こちらは必要ありません。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')
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