The component renders first with roomId = "alpha" and installs its effect. Before the connect timer fires, it renders again with roomId = "beta". The effect has an empty dependency array and is not recreated.
Read Room.jsx. Which room ID does the timer pass to connect()?