Help us understand the problem. What is going on with this article?

React を Javascript で使ってみる

こんにちは
Node.jsもES2015も使わないReact入門」の記事を見つけたので、自分でもそっくり真似してみました。「±数字」の部分をクリックすると count の値が増減します。React Hooks を使っています。

スクリーンショット 2019-09-07 0.56.36.jpg

react.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Minimal React</title>
  </head>
  <body>
    <div id="app"></app>
    <script src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script>
let CounterApp = () => {
  let mySetCount = n => {
    let col = n>0?"blue":"red";
    return React.createElement("span", {
      style:{color:col, border:"1px solid " + col},
      onClick: () => setCount(count + n),
    }, (n>0?"+":"") + String(n))
  }
  const [count, setCount] = React.useState(0);
  return React.createElement("span", null,
    React.createElement("span", {style: {textDecoration: "underline"}}, "count: " + count),
    React.createElement("span", null, ""),
    mySetCount(2),
    mySetCount(1),
    mySetCount(-1),
    mySetCount(-2),
  )
}

var rootElement = React.createElement(CounterApp, null)
ReactDOM.render(rootElement, document.getElementById("app"))
    </script>
  </body>
</html>
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away