Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: removal of non-existing listener should not break updating ref (#…
…10067) Calling `removeListener` on event that doesn't have any listeners will add new key for that event to listeners with value `undefined`. After that attempts to set `ref.current` will fail with "Cannot read property 'forEach' of undefined" error. Fix is quite simple. Just needed to add check if there is listeners for the given event. FYI @satya164. This is related to your recent change acdde18
- Loading branch information