You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To unsubscribe from an event, call the `off` method on the reference passing it the event name and the function that the `on` method returned. This can be used within any useEffect hooks to automatically unsubscribe when the hook needs to unsubscribe itself.
> **Note:** The `off` method requires the same `ref` as specified on the corresponding `on` method. The event handler specified in the `on` method must be unique. If a common event handler is used for multiple events, an anonymous function can be used to invoke the common handler.
0 commit comments