Frontend Development ยท React
How would you answer an interview scenario involving useEffect and side effects in React?
If a component subscribes to a WebSocket channel, create the subscription in an effect and return a cleanup function that unsubscribes when the channel or component changes.