update useSmoothCount syntax

This commit is contained in:
cnrad
2022-04-16 17:15:55 -04:00
parent 92f76139ca
commit 0551bff539
3 changed files with 6 additions and 46 deletions

View File

@@ -10,7 +10,7 @@ export default function Home({ userCount }: { userCount: number }) {
const [copyState, setCopyState] = useState("Copy");
const countRef = useRef<HTMLSpanElement | null>(null);
const counter = useSmoothCount(countRef, userCount, 3, { curve: [0, 1, 0, 1] });
const counter = useSmoothCount({ ref: countRef, target: userCount, duration: 3, curve: [0, 1, 0, 1] });
const copy = () => {
navigator.clipboard.writeText(