Skip to content

Commit

Permalink
fix: addEventListenerWrap param target may be nullish (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosrat committed May 29, 2023
1 parent 8df1c3f commit 615d435
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Dom/addEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export default function addEventListenerWrap(target, eventType, cb, option) {
ReactDOM.unstable_batchedUpdates(cb, e);
}
: cb;
if (target.addEventListener) {
if (target?.addEventListener) {
target.addEventListener(eventType, callback, option);
}
return {
remove: () => {
if (target.removeEventListener) {
if (target?.removeEventListener) {
target.removeEventListener(eventType, callback, option);
}
},
Expand Down

1 comment on commit 615d435

@vercel
Copy link

@vercel vercel bot commented on 615d435 May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

util – ./

util.vercel.app
util-react-component.vercel.app
util-git-master-react-component.vercel.app

Please sign in to comment.