Thiru LogsAll FAQs
Frontend Development ยท React

How would you answer an interview scenario involving useEffect and side effects in React?

AdvancedUpdated 2026-08-08

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.

#react#useeffect