<div id="app"></div>
import { useEffect, useState } from "https://esm.sh/react";
import ReactDOM from "https://esm.sh/react-dom";
function App() {
  const [count, setCount] = useState(0);
  const handleClickEvent = () => {
    setCount(prev => prev + 1)
  };
  return (<div>
      <h1>{ count }</h1>
    <button onClick={handleClickEvent}>add count</button>
  </div>)
}

ReactDOM.render(<App />, document.querySelector("#app"));
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js