Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
Something went wrong. Try again.
214 B · 7 lines
TypeScript
at commit befbe0c4
12345678import { useCallback, useState } from 'react'
export function useCounter() { const [count, setCount] = useState(0) const increment = useCallback(() => setCount(x => x + 1), []) return { count, increment }}