「React入門」ReactDOM.renderでHello, worldを出力するサンプル

書式
ReactDOM.render(
some code
);
使用例

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello React!</title>
<script src="/react/16.4.0/umd/react.development.js"></script>
<script src="/react-dom/16.4.0/umd/react-dom.development.js"></script>
<script src="/babel-standalone/6.26.0/babel.min.js"></script>
</head>
<body>

<div id="cft"></div>
<script type="text/babel">
ReactDOM.render(
      <h1>Hello, world!</h1>,
      document.getElementById('cft')
);
</script>

</body>
</html>

 

React.js

Posted by arkgame