In order to keep state with React hooks, use the useState
method.
import React, { useState } from 'react'
const App() {
const [count, setCount] = useState(0)
return (
<div>
Clicked {count} times.
<button onClick={() => setCount(count + 1)}>Click</button>
</div>
)
}