<div class="container"></div>
const {useRef,useState} = React

const App = () => {
  const [, dispatch] = useState<{}>();
  const count = useRef(0);
  return (
    <div
      onClick={() => {
        count.current++;
        dispatch({});
      }}
    >
      {count.current}
    </div>
  );
};

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

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/react/17.0.2/umd/react.production.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.production.min.js
  3. https://cdn.skypack.dev/@types/react@17.0.4