Merge pull request #665 from qianL93/patch-1

fix: useSize avoid crash in Safari 11
This commit is contained in:
Vadim Dalecky 2019-10-28 14:08:31 +01:00 committed by GitHub
commit c23e105bcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,7 @@ const useSize = (
}
return () => {
if (window) {
if (window && window.removeEventListener) {
window.removeEventListener('resize', setSize);
}
};