fix: useSize avoid crash in Safari 11

This commit is contained in:
qianL93 2019-10-10 14:14:54 +08:00 committed by GitHub
parent 706f660781
commit da0e66bb89
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);
}
};