Fairfield Consulting is a full-service web development consultancy based in Detroit, MI. We specialize in building custom websites, web applications and APIs for small businesses and startups.
import { useState } from 'react'
export function Counter() {
const [count, setCount] = useState(0)
const increment = () => {
setCount((previousCount) => previousCount + 1)
}
return (
<div>
<p>Count: {count}</p>
<button onClick={increment}>Increment</button>
</div>
)
}