diff --git a/packages/create-vite/template-vanilla/counter.js b/packages/create-vite/template-vanilla/counter.js index 12ae65abfaea09..881e2d7adf529f 100644 --- a/packages/create-vite/template-vanilla/counter.js +++ b/packages/create-vite/template-vanilla/counter.js @@ -4,6 +4,6 @@ export function setupCounter(element) { counter = count element.innerHTML = `count is ${counter}` } - element.addEventListener('click', () => setCounter(++counter)) + element.addEventListener('click', () => setCounter(counter + 1)) setCounter(0) }