function App () {
const [count1, setCount1] = React.useState(1)
let count2 = 1
const handleIncrement1 = () => {
// we trigger a re-render by setting a new state
setCount1(count1 + 1)
}
const handleIncrement2 = () => {
// nothing happens!
count2++
}
return (
<div>
Reactive count: {count1}
<br />
<button onClick={handleIncrement1}>
Handle increment reactive count
</button>
<br />
Static count: {count2}
<br />
<button onClick={handleIncrement2}>
Handle increment static count
</button>
</div>
)
}