A counter displays its value and a doubled version that updates in sync with every increment.
Click Increment - Count goes up correctly but Doubled stays at 0 forever.
Ask yourself whether `doubled` really needs to be state at all.
Ask yourself whether `doubled` really needs to be state at all.
Why this fixes it
`doubled` was stored as a separate `useState` and synced via a `useEffect` with an empty dependency array - the effect ran once on mount and never again, leaving `doubled` frozen at `0`. Removing both and computing `const doubled = count * 2` inline during render means the value is recalculated on every render from the current `count` with no synchronization lag.