@os-design/utils
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -12,3 +12,3 @@ "use strict"; | ||
const element = target instanceof Element ? target : target.current; | ||
if (element === null) | ||
if (element === null || typeof window === 'undefined') | ||
return 0; | ||
@@ -26,3 +26,3 @@ const style = window.getComputedStyle(element).getPropertyValue('font-size'); | ||
}, [target]); | ||
useEvent_1.default(window, 'resize', resizeListener); | ||
useEvent_1.default((typeof window !== 'undefined' ? window : undefined), 'resize', resizeListener); | ||
return fontSize; | ||
@@ -29,0 +29,0 @@ }; |
@@ -38,3 +38,3 @@ "use strict"; | ||
}, []); | ||
useEvent_1.default(window, 'scroll', updateSafeAreaInset); | ||
useEvent_1.default((typeof window !== 'undefined' ? window : undefined), 'scroll', updateSafeAreaInset); | ||
return safeAreaInset; | ||
@@ -41,0 +41,0 @@ }; |
@@ -14,5 +14,5 @@ "use strict"; | ||
react_1.useEffect(() => resizeListener(), [resizeListener]); | ||
useEvent_1.default(window, 'resize', resizeListener); | ||
useEvent_1.default((typeof window !== 'undefined' ? window : undefined), 'resize', resizeListener); | ||
}; | ||
exports.default = useVh; | ||
//# sourceMappingURL=index.js.map |
@@ -16,3 +16,3 @@ "use strict"; | ||
}, []); | ||
useEvent_1.default(window, 'resize', resizeListener); | ||
useEvent_1.default((typeof window !== 'undefined' ? window : undefined), 'resize', resizeListener); | ||
return size; | ||
@@ -19,0 +19,0 @@ }; |
{ | ||
"name": "@os-design/utils", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"license": "UNLICENSED", | ||
@@ -19,3 +19,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@os-design/styles": "^1.0.9", | ||
"@os-design/styles": "^1.0.10", | ||
"@types/resize-observer-browser": "^0.1.5", | ||
@@ -27,3 +27,3 @@ "react": ">=17" | ||
}, | ||
"gitHead": "2f47880b4b2376ae80e4a45e773d0393dc191ac2" | ||
"gitHead": "55ea713c7464cd4bd3a85fe8c4d8a2ac6d4ad466" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45962