Summary
If you look at ChatRoom.js in an example of the 4. Fix a connection switch code in Try out some challenge, it looks like the image below.
The useState is not used in the code, so it is correct to remove it.
Page
https://react.dev/learn/lifecycle-of-reactive-effects
Details
No response