Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-div-100vh

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-div-100vh - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0-beta.1

7

dist/cjs/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc