no-use-state.tsx
-> 0
00import { useState } from "react"
01
02export function LikeCounter() {
03 const pressed = 0
04 return <>
05 <div>{ pressed }</div>
06 <button onClick={ () => pressed += 1 }>Like</button>
07 <button onClick={ () => pressed = 0 }>Reset</button>
08 </>
09}
localhost:3000
0
Normal variables don't trigger rerenders.