react-div-100vh
Advanced tools
Comparing version 0.6.0 to 0.7.0-beta.1
@@ -53,3 +53,3 @@ "use strict"; | ||
warned = true; | ||
console.warn('<ReactDiv100vh /> overrides the height property of the style prop'); | ||
console.warn('<Div100vh /> overrides the height property of the style prop'); | ||
} | ||
@@ -78,9 +78,8 @@ var styleWithRealHeight = __assign(__assign({}, style), { height: height ? height + "px" : '100vh' }); | ||
function measureHeight() { | ||
var _a; | ||
if (!isClient()) | ||
return null; | ||
return ((_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.clientHeight) || window.innerHeight; | ||
return window.innerHeight; | ||
} | ||
exports.measureHeight = measureHeight; | ||
// Once we ended up on client, the first render must look the same as on | ||
// Once we ended up on the client, the first render must look the same as on | ||
// the server so hydration happens without problems. _Then_ we immediately | ||
@@ -87,0 +86,0 @@ // schedule a subsequent update and return the height measured on the client. |
@@ -31,3 +31,3 @@ var __assign = (this && this.__assign) || function () { | ||
warned = true; | ||
console.warn('<ReactDiv100vh /> overrides the height property of the style prop'); | ||
console.warn('<Div100vh /> overrides the height property of the style prop'); | ||
} | ||
@@ -55,8 +55,7 @@ var styleWithRealHeight = __assign(__assign({}, style), { height: height ? height + "px" : '100vh' }); | ||
export function measureHeight() { | ||
var _a; | ||
if (!isClient()) | ||
return null; | ||
return ((_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.clientHeight) || window.innerHeight; | ||
return window.innerHeight; | ||
} | ||
// Once we ended up on client, the first render must look the same as on | ||
// Once we ended up on the client, the first render must look the same as on | ||
// the server so hydration happens without problems. _Then_ we immediately | ||
@@ -63,0 +62,0 @@ // schedule a subsequent update and return the height measured on the client. |
{ | ||
"name": "react-div-100vh", | ||
"version": "0.6.0", | ||
"version": "0.7.0-beta.1", | ||
"description": "A workaround for the '100vh' issue in mobile browsers", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -64,3 +64,4 @@ # `Div100vh` React component and `use100vh` React hook | ||
well, so feel free to use it, even without React. Currently it returns | ||
`document.documentElement?.clientHeight || window.innerHeight` or `null`. | ||
`document.documentElement?.clientHeight || window.innerHeight` if executed in a | ||
browser or `null` if on a server. | ||
@@ -67,0 +68,0 @@ ## Testing |
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
72
12369
175