Logger lists config in its dependency array. Yet bumping the counter causes the Logger to fire its effect over and over. Open the preview — the counter visible at the top is "how many times the Logger effect has fired since you opened the page."
Symptoms
- Click the + button a few times —
#fires grows by one with each click, even though config is just { level: 'info' } and never actually changes
Your Task
Make the Logger’s effect fire only once on mount, and never again from unrelated re-renders.
Think about it: {} is a new object on every render. React’s dependency array uses Object.is to compare. A "shape-equal" object isn’t reference-equal. Which hook gives you a stable reference between renders?