<div id="root" />
const { useState } = React;
const { render } = ReactDOM;

const App = () => {
  const [count, setCount] = useState(0);
  return (
    <div>
      <div><strong>Count:</strong> {count}</div>
      <button onClick={() => setCount(count + 1)}>Increment</button>
      <button onClick={() => setCount(count - 1)}>Decrement</button>
    </div>
  );
};

render(<App />, document.getElementById('root'));
View Compiled
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://unpkg.com/react@16.7.0-alpha.2/umd/react.production.min.js
  2. https://unpkg.com/react-dom@16.7.0-alpha.2/umd/react-dom.production.min.js