Loading…
Loading…
A colleague is building a new chat component: subscribe to messages by roomId, an input, and send. Works in manual testing, but the reviewer has seen this bug in other projects. Open the diff and find why switching rooms breaks the chat.
When reviewing a React component, always look at: 1. **useEffect dependency arrays** — complete? Any stale closures? 2. **setState in callbacks** — using functional updates? 3. **Effect cleanup** — are subscriptions/timers properly cleaned up? 4. **Props used inside the effect** — all in deps? Read the code and try to find what exactly breaks when switching rooms.