diff --git a/templates/react/app/components/Counter.tsx b/templates/react/app/components/Counter.tsx index aab6bb5..6b10b31 100644 --- a/templates/react/app/components/Counter.tsx +++ b/templates/react/app/components/Counter.tsx @@ -35,7 +35,7 @@ export default function Counter() { const increment = () => { // optimistic local update - setCount((prev) => prev ?? 0 + 1); + setCount((prev) => (prev ?? 0) + 1); // send the update to the server socket.send("increment"); };