<div id="app"></div>
const {useState } = React
function Counter(){
let [number,setCount ] = useState(0);
return (
<div>
<h1>{number}</h1>
<button onClick={()=>setCount(number+1)} >Increment</button>
<button onClick={()=>setCount(number-1)} >Deccrement</button>
</div>
)
}
ReactDOM.render(<Counter/>, document.getElementById('app'))
View Compiled
This Pen doesn't use any external CSS resources.