A user can receive events of a room that they are currently participating. Users will be notified when other participants enter or leave the room, change their media settings or when the room is deleted.
Add an event delegate for the user to receive events that occur in a room that the user joins as a participant.
To remove the event handler, you can call
unsubscribe() from clean-up of useEffect.