Skip to content

Commit

Permalink
fix: useSize avoid crash in Safari 11
Browse files Browse the repository at this point in the history
  • Loading branch information
qianL93 authored Oct 10, 2019
1 parent 706f660 commit da0e66b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useSize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const useSize = (
}

return () => {
if (window) {
if (window && window.removeEventListener) {
window.removeEventListener('resize', setSize);
}
};
Expand Down

0 comments on commit da0e66b

Please sign in to comment.