Skip to content

Instantly share code, notes, and snippets.

@chihirokaasan
Last active Dec 7, 2015
Embed
What would you like to do?
<!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